Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: improve github actions #1573

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
99 changes: 7 additions & 92 deletions .github/workflows/nodejs.yml
Expand Up @@ -17,24 +17,11 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16

- name: Determine npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"

- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: 'npm'

- run: npm ci
- run: npm run lint
Expand All @@ -56,6 +43,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Generate TLS Certificate
run: |
Expand Down Expand Up @@ -87,22 +75,6 @@ jobs:
}
}' | jq --arg certificate "$(cat ./test/fixtures/mssql.crt)" '.config.options.cryptoCredentialsDetails.ca |= $certificate' > ~/.tedious/test-connection.json

- name: Upgrade npm
run: npm install -g npm
if: ${{ matrix.node-version == '6.x' }}

- name: Determine npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"

- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- run: npm ci

- name: run unit tests
Expand Down Expand Up @@ -230,6 +202,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dbatools
shell: powershell
Expand Down Expand Up @@ -288,22 +261,6 @@ jobs:
}
}' | jq --arg certificate "$(cat ./test/fixtures/mssql.crt)" '.config.options.cryptoCredentialsDetails.ca |= $certificate' > ~/.tedious/test-connection.json

- name: Upgrade npm
run: npm install -g npm
if: ${{ matrix.node-version == '6.x' }}

- name: Determine npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"

- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- run: npm ci

- name: run unit tests
Expand Down Expand Up @@ -372,17 +329,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'

- name: Determine npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci

- run: mkdir ~/.tedious
Expand Down Expand Up @@ -426,18 +374,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16

- name: Determine npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"

- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: 'npm'

- run: npm ci

Expand Down Expand Up @@ -485,18 +422,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16

- name: Determine npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"

- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: 'npm'

- run: npm ci

Expand Down Expand Up @@ -541,18 +467,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16

- name: Determine npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"

- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: 'npm'

- run: npm ci

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Expand Up @@ -14,6 +14,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'

- name: Tag latest release
run: |
Expand Down