Skip to content

Commit fb04d3f

Browse files
authored
Merge pull request #174 from LowlyDBA/development
Development
2 parents 4d8629e + b4c96f7 commit fb04d3f

27 files changed

+322
-250
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM node:latest
2+
3+
LABEL "com.github.actions.name"="TSQLLint action"
4+
LABEL "com.github.actions.description"="Lint T-SQL files"
5+
LABEL "com.github.actions.icon"="database"
6+
LABEL "com.github.actions.color"="green"
7+
8+
###############################
9+
# Add add'l packages required #
10+
###############################
11+
RUN apt-get -qq update \
12+
&& apt-get -qq install libunwind8 \
13+
&& yarn global add tsqllint
14+
15+
# Copies your code file from your action repository to the filesystem path `/` of the container
16+
COPY entrypoint.sh /entrypoint.sh
17+
18+
# Code file to execute when the docker container starts up (`entrypoint.sh`)
19+
RUN chmod +x ./entrypoint.sh
20+
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# TSQLLint Github Action
2+
3+
This action runs [TSQLLint](https://git.io/JILDv) via a Github Action.
4+
5+
## Inputs
6+
7+
### `file-dir-1`
8+
9+
**Required** First path to file or directory to lint.
10+
11+
### `file-dir-2`
12+
13+
**Required** Second path to file or directory to lint.
14+
15+
### `config`
16+
17+
**Optional** Location of a TSQLLint configuration file, otherwise defaults are used.
18+
19+
## Example usage
20+
21+
TBD
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: 'TSQLLint'
2+
author: '@LowlyDBA'
3+
description: 'Lint T-SQL files'
4+
inputs:
5+
# For some reason, need to do wildcard twice to get all recursive files/folders
6+
file-dir-1:
7+
description: 'First file/dir'
8+
required: true
9+
default: '*.sql'
10+
file-dir-2:
11+
description: 'Second file/dir'
12+
required: true
13+
default: '*.sql'
14+
config:
15+
description: 'Config file'
16+
required: false
17+
# outputs:
18+
# time: # id of output
19+
# description: 'The time we greeted you'
20+
runs:
21+
using: 'docker'
22+
image: 'Dockerfile'
23+
args:
24+
- ${{ inputs.file-dir-1 }}
25+
- ${{ inputs.file-dir-2 }}
26+
- ${{ inputs.config }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh -l
2+
3+
echo "**********************************************"
4+
echo "TSQLLint by Nathan Boyd - https://git.io/JILDv"
5+
echo "**********************************************"
6+
7+
if [ -z "$3" ]
8+
then
9+
echo "No config file found, using defaults."
10+
tsqllint $1 $2
11+
else
12+
echo "Using config file $3"
13+
tsqllint $1 $2 -c $3
14+
fi

.github/in-solidarity.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
---
3+
# https://github.com/jpoehnelt/in-solidarity-bot
4+
#rules:
5+
# master:
6+
# level: off
7+
ignore:
8+
- ".github/in-solidarity.yml" # default
9+
- "**/*.yml"

.github/workflows/super-linter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- name: Lint Code Base
4646
uses: docker://github/super-linter:v3.13.5
4747
env:
48+
LINTER_RULES_PATH: .github/linter-conf
4849
VALIDATE_MARKDOWN: true
4950
VALIDATE_POWERSHELL: true
5051
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tsqllint.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
############################
3+
############################
4+
## TSQLLint Github Action ##
5+
############################
6+
############################
7+
name: TSQLLint Code Base
8+
9+
# Start job on all pushes
10+
on: [push]
11+
12+
# Set the job
13+
jobs:
14+
tsqllint_lint_job:
15+
name: TSQLLint
16+
runs-on: ubuntu-latest
17+
18+
# Steps
19+
steps:
20+
21+
# Checkout the code base
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
# Run TSQLLint against code
26+
- name: TSQLLint
27+
uses: ./.github/actions/tsqllint-action
28+
id: Lint
29+
with:
30+
file-dir-1: '*.sql'
31+
file-dir-2: '*.sql'
32+
config: './.github/linter-conf/.tsqllintrc_150'

appveyor/appveyor.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
version: 1.5.{build}
1+
version: 1.6.{build}
22

33
pull_requests:
44
do_not_increment_build_number: false
55
max_jobs: 2
66
build: off
7+
skip_commits:
8+
author: Appveyor
79

810
environment:
911
access_token:
@@ -19,45 +21,40 @@ environment:
1921
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
2022
MSSQL: SQL2019
2123
DB_INSTANCE: localhost\SQL2019
22-
#LINT_CONFIG: .\appveyor\tsqllint\.tsqllintrc_150
2324
LATEST: True
2425

2526
# Azure SQL Env
2627
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
2728
MSSQL: AZURESQL
28-
#LINT_CONFIG: .\appveyor\tsqllint\.tsqllintrc_150
2929
TARGET_DB: expresssql
3030
DB_INSTANCE: expresssql.database.windows.net
3131
LATEST: False
3232
COV_REPORT: appveyor\sqlcover\Coverage_azuresql.opencoverxml
3333
AZURE_SQL_USER: lowlysa
3434
AzureSQL: True
3535

36+
# SQL Server Envs
3637
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
3738
MSSQL: SQL2017
3839
DB_INSTANCE: localhost\SQL2017
39-
#LINT_CONFIG: .\appveyor\tsqllint\.tsqllintrc_140
4040
LATEST: False
4141
AzureSQL: False
4242

4343
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
4444
MSSQL: SQL2016
4545
DB_INSTANCE: localhost\SQL2016
46-
#LINT_CONFIG: .\appveyor\tsqllint\.tsqllintrc_130
4746
LATEST: False
4847
AzureSQL: False
4948

5049
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
5150
MSSQL: SQL2014
5251
DB_INSTANCE: localhost\SQL2014
53-
#LINT_CONFIG: .\appveyor\tsqllint\.tsqllintrc_120
5452
LATEST: False
5553
AzureSQL: False
5654

5755
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
5856
MSSQL: SQL2012SP1
5957
DB_INSTANCE: localhost\SQL2012SP1
60-
#LINT_CONFIG: .\appveyor\tsqllint\.tsqllintrc_110
6158
LATEST: False
6259
AzureSQL: False
6360

0 commit comments

Comments
 (0)