-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now the CI workflow runs on every pull request and every push to the main branch. This runs ESLint, Prettier, tsd, and Vitest, all in their own job. The Integration tests workflow runs on the main branch. It runs all tests, publishes a coverage badge, and sends a Slack notification on failure.
- Loading branch information
1 parent
0868ca5
commit 321d0ae
Showing
5 changed files
with
66 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
eslint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
- run: corepack yarn | ||
- run: corepack yarn eslint . | ||
|
||
prettier: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
- run: corepack yarn | ||
- run: corepack yarn prettier --check . | ||
|
||
tsd: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
- run: corepack yarn | ||
- run: corepack yarn tsd | ||
|
||
vitest: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: | ||
- 18 | ||
- 20 | ||
- 22 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: corepack yarn | ||
- run: corepack yarn vitest run --coverage ./test/unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: CI | ||
name: Integration tests | ||
|
||
on: | ||
workflow_dispatch: | ||
|
@@ -11,7 +11,6 @@ on: | |
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
# Integration tests are not yet ready to run in parallel | ||
max-parallel: 1 | ||
|
@@ -20,53 +19,37 @@ jobs: | |
- 18 | ||
- 20.15.1 | ||
- 22.3.0 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- run: corepack yarn | ||
- run: corepack yarn lint | ||
|
||
- name: Download cloudflared | ||
run: | | ||
curl -fsSLo cloudflared-linux-amd64 https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 | ||
chmod +x cloudflared-linux-amd64 | ||
- run: curl -fsSLo cloudflared-linux-amd64 https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 | ||
- run: chmod +x cloudflared-linux-amd64 | ||
# can be used for debugging: | ||
# - name: Setup tmate session | ||
# uses: mxschmitt/action-tmate@v3 | ||
|
||
- run: corepack yarn test-all | ||
# - uses: mxschmitt/action-tmate@v3 | ||
- run: corepack yarn vitest run --coverage | ||
env: | ||
TRANSLOADIT_KEY: ${{ secrets.TRANSLOADIT_KEY }} | ||
TRANSLOADIT_SECRET: ${{ secrets.TRANSLOADIT_SECRET }} | ||
NODE_OPTIONS: --trace-deprecation --trace-warnings | ||
CLOUDFLARED_PATH: ./cloudflared-linux-amd64 | ||
DEBUG: 'transloadit:*' | ||
|
||
- name: Generate the badge from the json-summary | ||
run: node test/generate-coverage-badge.js coverage/coverage-summary.json | ||
|
||
- name: Move HTML report and badge to the correct location | ||
run: | | ||
mv coverage/lcov-report static-build | ||
mv coverage-badge.svg static-build/ | ||
- run: node test/generate-coverage-badge.js coverage/coverage-summary.json | ||
- run: mv coverage/lcov-report static-build | ||
- run: mv coverage-badge.svg static-build/ | ||
# *** BEGIN PUBLISH STATIC SITE STEPS *** | ||
# Use the standard checkout action to check out the destination repo to a separate directory | ||
# See https://github.com/mifi/github-action-push-static | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
with: | ||
ssh-key: ${{ secrets.COVERAGE_REPO_SSH_PRIVATE_KEY }} | ||
repository: transloadit/node-sdk-coverage | ||
path: static-files-destination | ||
|
||
# Push coverage data | ||
- if: matrix.node == '18' | ||
- if: matrix.node == '22.3.0' | ||
run: | | ||
git config --global user.name github-actions | ||
git config --global user.email [email protected] | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters