Skip to content

Commit

Permalink
feat: initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensby committed Sep 3, 2023
0 parents commit ba0ea7b
Show file tree
Hide file tree
Showing 26 changed files with 22,401 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .commitlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends:
- '@commitlint/config-conventional'
rules:
body-max-line-length: [0]
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib/
31 changes: 31 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"parserOptions": {
"sourceType": "module"
},
"env": {
"es6": true,
"mocha": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"comma-dangle": ["error", "always-multiline"],
"no-shadow": ["error"],
"semi": ["error", "always"]
},
"overrides": [{
"files": ["test/**/*"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
}]
}
154 changes: 154 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: Lint, Test & Release

on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:

permissions:
contents: read

jobs:
commitlint:
name: Lint commits
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: Install dependencies
run: npm clean-install
- name: Lint commit
if: github.event_name == 'push'
run: npx commitlint --from HEAD~1 --to HEAD --verbose
- name: Lint commits
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
codelint:
name: Lint code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: Install dependencies
run: npm clean-install
- name: Lint code
run: npm run lint
buildlint:
name: Check built files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: Install dependencies
run: npm clean-install
- name: Build files
run: npm run build
- name: Check built files
run: git diff-files --quiet -w
test:
name: Run tests
runs-on: ubuntu-latest
needs:
- commitlint
- codelint
- buildlint
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: Install dependencies
run: npm clean-install
- name: Run tests
run: npm run test -- --forbid-only
coverage:
name: Test coverage
runs-on: ubuntu-latest
needs:
- commitlint
- codelint
- buildlint
permissions:
contents: read
pull-requests: write # to be able to comment on released pull requests
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: Install deps
run: npm ci
- name: Test code
run: npm run test:coverage -- --forbid-only
- name: Report coverage
run: |
echo "# Code coverage" >> $GITHUB_STEP_SUMMARY
npx nyc report | sed --expression='1d;$d' >> $GITHUB_STEP_SUMMARY
if: always()
# release:
# name: Release
# concurrency: release
# if: ${{ github.event_name == 'push' && github.actor != 'dependabot[bot]' }}
# runs-on: ubuntu-latest
# needs:
# - commitlint
# - codelint
# - buildlint
# - test
# permissions:
# contents: write # to be able to publish a GitHub release
# issues: write # to be able to comment on released issues
# pull-requests: write # to be able to comment on released pull requests
# id-token: write # to enable use of OIDC for npm provenance
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: Setup Node.js
# uses: actions/setup-node@v3
# with:
# node-version: "lts/*"
# cache: 'npm'
# - name: Install dependencies
# run: npm clean-install
# - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
# run: npm audit signatures
# - name: Release
# env:
# NPM_CONFIG_PROVENANCE: true
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: npx semantic-release
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.nyc_output/
/.package/
/node_modules/
/coverage/
6 changes: 6 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "@istanbuljs/nyc-config-typescript",
"include": ["src"],
"exclude": ["src/main.ts", "src/pre.ts", "src/post.ts"],
"all": true
}
8 changes: 8 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins:
- '@semantic-release/commit-analyzer'
- '@semantic-release/release-notes-generator'
- ['@semantic-release/changelog', {changelogTitle: '# Changelog'}]
- ['@semantic-release/npm', { npmPublish: false, tarballDir: "./.package" }]
- '@semantic-release/github'
- ['@semantic-release/git', {message: "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"}]
- ['@semantic-release/exec', { publishCmd: "./misc/publish.sh 'v${nextRelease.version}'" }]
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

## 1.0.0 (2023-09-03)

### Features

* initial release
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2023 Daniel Hensby and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Setup SQL Server Action

This action installs a version of SQL Server on Windows based GitHub Action Runners.

## Usage

See [action.yml](./action.yml):
<!-- start usage -->
```yaml
- uses: tediousjs/setup-sqlserver@v1
with:
# Skip OS checks that will stop installation attempts preemptively.
# Default: false
skip-os-check: ''

# Version to use. Examples: 2008, 2012, 2014, etc. "latest" can also be used.
# Default: latest
sqlserver-version: ''

# The SA user password to use.
# Default: yourStrong(!)Password
sa-password: ''

# The database collation to use.
# Default: SQL_Latin1_General_CP1_CI_AS
db-collation: ''

# Any custom install arguments you wish to use. These must be in the format of
# "/ARG=VAL".
install-arguments: ''

# Wait for the database to respond successfully to queries before completing the
# action. A maximum of 10 attempts is made.
# Default: true
wait-for-ready: ''
```
<!-- end usage -->
### Basic usage
```yml
- name: Install SQL Server
uses: ./
with:
sqlserver-version: sql-latest
```
29 changes: 29 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Setup SQL Server environment'
description: 'Setup an SQL Server environment in your GitHub runner.'
author: 'tediousjs'
inputs:
skip-os-check:
description: 'Skip OS checks that will stop installation attempts preemptively.'
default: 'false'
sqlserver-version:
description: 'Version to use. Examples: 2008, 2012, 2014, etc. "latest" can also be used.'
default: 'latest'
sa-password:
description: 'The SA user password to use.'
default: 'yourStrong(!)Password'
db-collation:
description: 'The database collation to use.'
default: 'SQL_Latin1_General_CP1_CI_AS'
install-arguments:
description: 'Any custom install arguments you wish to use. These must be in the format of "/ARG=VAL".'
wait-for-ready:
description: 'Wait for the database to respond successfully to queries before completing the action. A maximum of 10 attempts is made.'
default: 'true'
outputs:
sa-password:
description: 'The SA password, this will be the same as the input, but can be useful when relying on the default value.'
instance-name:
description: 'The instance name for the SQL Server.'
runs:
using: 'node16'
main: 'lib/main/index.js'
1 change: 1 addition & 0 deletions lib/main/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit ba0ea7b

Please sign in to comment.