Skip to content

Commit ba0ea7b

Browse files
committed
feat: initial release
0 parents  commit ba0ea7b

26 files changed

+22401
-0
lines changed

.commitlintrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
extends:
2+
- '@commitlint/config-conventional'
3+
rules:
4+
body-max-line-length: [0]

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lib/

.eslintrc.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": [
5+
"@typescript-eslint"
6+
],
7+
"parserOptions": {
8+
"sourceType": "module"
9+
},
10+
"env": {
11+
"es6": true,
12+
"mocha": true,
13+
"node": true
14+
},
15+
"extends": [
16+
"eslint:recommended",
17+
"plugin:@typescript-eslint/eslint-recommended",
18+
"plugin:@typescript-eslint/recommended"
19+
],
20+
"rules": {
21+
"comma-dangle": ["error", "always-multiline"],
22+
"no-shadow": ["error"],
23+
"semi": ["error", "always"]
24+
},
25+
"overrides": [{
26+
"files": ["test/**/*"],
27+
"rules": {
28+
"@typescript-eslint/no-explicit-any": "off"
29+
}
30+
}]
31+
}

.github/workflows/release.yml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
name: Lint, Test & Release
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'dependabot/**'
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
commitlint:
14+
name: Lint commits
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
persist-credentials: false
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: 16.x
26+
cache: 'npm'
27+
- name: Install dependencies
28+
run: npm clean-install
29+
- name: Lint commit
30+
if: github.event_name == 'push'
31+
run: npx commitlint --from HEAD~1 --to HEAD --verbose
32+
- name: Lint commits
33+
if: github.event_name == 'pull_request'
34+
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
35+
codelint:
36+
name: Lint code
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v3
41+
with:
42+
persist-credentials: false
43+
- name: Setup Node.js
44+
uses: actions/setup-node@v3
45+
with:
46+
node-version: 16.x
47+
cache: 'npm'
48+
- name: Install dependencies
49+
run: npm clean-install
50+
- name: Lint code
51+
run: npm run lint
52+
buildlint:
53+
name: Check built files
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Checkout code
57+
uses: actions/checkout@v3
58+
with:
59+
persist-credentials: false
60+
- name: Setup Node.js
61+
uses: actions/setup-node@v3
62+
with:
63+
node-version: 16.x
64+
cache: 'npm'
65+
- name: Install dependencies
66+
run: npm clean-install
67+
- name: Build files
68+
run: npm run build
69+
- name: Check built files
70+
run: git diff-files --quiet -w
71+
test:
72+
name: Run tests
73+
runs-on: ubuntu-latest
74+
needs:
75+
- commitlint
76+
- codelint
77+
- buildlint
78+
steps:
79+
- name: Checkout code
80+
uses: actions/checkout@v3
81+
with:
82+
persist-credentials: false
83+
- name: Setup Node.js
84+
uses: actions/setup-node@v3
85+
with:
86+
node-version: 16.x
87+
cache: 'npm'
88+
- name: Install dependencies
89+
run: npm clean-install
90+
- name: Run tests
91+
run: npm run test -- --forbid-only
92+
coverage:
93+
name: Test coverage
94+
runs-on: ubuntu-latest
95+
needs:
96+
- commitlint
97+
- codelint
98+
- buildlint
99+
permissions:
100+
contents: read
101+
pull-requests: write # to be able to comment on released pull requests
102+
steps:
103+
- uses: actions/checkout@v3
104+
with:
105+
persist-credentials: false
106+
- name: Use Node.js
107+
uses: actions/setup-node@v3
108+
with:
109+
node-version: 16.x
110+
cache: 'npm'
111+
- name: Install deps
112+
run: npm ci
113+
- name: Test code
114+
run: npm run test:coverage -- --forbid-only
115+
- name: Report coverage
116+
run: |
117+
echo "# Code coverage" >> $GITHUB_STEP_SUMMARY
118+
npx nyc report | sed --expression='1d;$d' >> $GITHUB_STEP_SUMMARY
119+
if: always()
120+
# release:
121+
# name: Release
122+
# concurrency: release
123+
# if: ${{ github.event_name == 'push' && github.actor != 'dependabot[bot]' }}
124+
# runs-on: ubuntu-latest
125+
# needs:
126+
# - commitlint
127+
# - codelint
128+
# - buildlint
129+
# - test
130+
# permissions:
131+
# contents: write # to be able to publish a GitHub release
132+
# issues: write # to be able to comment on released issues
133+
# pull-requests: write # to be able to comment on released pull requests
134+
# id-token: write # to enable use of OIDC for npm provenance
135+
# steps:
136+
# - name: Checkout
137+
# uses: actions/checkout@v3
138+
# with:
139+
# fetch-depth: 0
140+
# - name: Setup Node.js
141+
# uses: actions/setup-node@v3
142+
# with:
143+
# node-version: "lts/*"
144+
# cache: 'npm'
145+
# - name: Install dependencies
146+
# run: npm clean-install
147+
# - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
148+
# run: npm audit signatures
149+
# - name: Release
150+
# env:
151+
# NPM_CONFIG_PROVENANCE: true
152+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
153+
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
154+
# run: npx semantic-release

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.nyc_output/
2+
/.package/
3+
/node_modules/
4+
/coverage/

.nycrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "@istanbuljs/nyc-config-typescript",
3+
"include": ["src"],
4+
"exclude": ["src/main.ts", "src/pre.ts", "src/post.ts"],
5+
"all": true
6+
}

.releaserc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
plugins:
2+
- '@semantic-release/commit-analyzer'
3+
- '@semantic-release/release-notes-generator'
4+
- ['@semantic-release/changelog', {changelogTitle: '# Changelog'}]
5+
- ['@semantic-release/npm', { npmPublish: false, tarballDir: "./.package" }]
6+
- '@semantic-release/github'
7+
- ['@semantic-release/git', {message: "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"}]
8+
- ['@semantic-release/exec', { publishCmd: "./misc/publish.sh 'v${nextRelease.version}'" }]

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
## 1.0.0 (2023-09-03)
4+
5+
### Features
6+
7+
* initial release

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2023 Daniel Hensby and contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Setup SQL Server Action
2+
3+
This action installs a version of SQL Server on Windows based GitHub Action Runners.
4+
5+
## Usage
6+
7+
See [action.yml](./action.yml):
8+
<!-- start usage -->
9+
```yaml
10+
- uses: tediousjs/setup-sqlserver@v1
11+
with:
12+
# Skip OS checks that will stop installation attempts preemptively.
13+
# Default: false
14+
skip-os-check: ''
15+
16+
# Version to use. Examples: 2008, 2012, 2014, etc. "latest" can also be used.
17+
# Default: latest
18+
sqlserver-version: ''
19+
20+
# The SA user password to use.
21+
# Default: yourStrong(!)Password
22+
sa-password: ''
23+
24+
# The database collation to use.
25+
# Default: SQL_Latin1_General_CP1_CI_AS
26+
db-collation: ''
27+
28+
# Any custom install arguments you wish to use. These must be in the format of
29+
# "/ARG=VAL".
30+
install-arguments: ''
31+
32+
# Wait for the database to respond successfully to queries before completing the
33+
# action. A maximum of 10 attempts is made.
34+
# Default: true
35+
wait-for-ready: ''
36+
```
37+
<!-- end usage -->
38+
39+
### Basic usage
40+
41+
```yml
42+
- name: Install SQL Server
43+
uses: ./
44+
with:
45+
sqlserver-version: sql-latest
46+
```

0 commit comments

Comments
 (0)