-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add bun to test matrix, measure coverage, enable CC reporting
- Loading branch information
1 parent
c6fcc02
commit eb03419
Showing
4 changed files
with
670 additions
and
936 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 |
---|---|---|
|
@@ -10,6 +10,8 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: ${{ github.ref == 'refs/heads/master' && '0' || '1' }} | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
|
@@ -20,9 +22,30 @@ jobs: | |
run: npm i | ||
|
||
- name: Run tests | ||
run: npm run test | ||
run: npm run test:cov | ||
|
||
- name: Codeclimate | ||
if: github.ref == 'refs/heads/master' | ||
uses: paambaati/[email protected] | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | ||
with: | ||
coverageLocations: | | ||
${{github.workspace}}/coverage/lcov.info:lcov | ||
test_pr: | ||
- name: Semantic Release | ||
if: github.ref == 'refs/heads/master' | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NPM_PROVENANCE: true | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} | ||
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | ||
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }} | ||
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | ||
run: npm_config_yes=true npx zx-semrel | ||
|
||
pr_node: | ||
if: ${{ github.event_name == 'pull_request' }} | ||
name: Test PR (Node v${{ matrix.node-version }}, OS ${{ matrix.os }}) | ||
strategy: | ||
|
@@ -50,49 +73,22 @@ jobs: | |
timeout-minutes: 2 | ||
run: npm test | ||
|
||
release: | ||
name: Release | ||
# https://github.community/t/trigger-job-on-tag-push-only/18076 | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
needs: test_push | ||
pr_bun: | ||
if: ${{ github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-22.04 | ||
|
||
permissions: | ||
checks: read | ||
statuses: write | ||
contents: write | ||
packages: write | ||
|
||
name: PR with Bun | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: master | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install deps | ||
run: npm i | ||
- name: Setup Bun | ||
uses: antongolub/action-setup-bun@v1 | ||
|
||
- name: Create .npmrc | ||
- name: Deps | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc | ||
echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" >> .npmrc | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
bun install | ||
ln -s ../ ./node_modules/zx-extra | ||
- name: Release | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | ||
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }} | ||
run: npm_config_yes=true npx zx-semrel | ||
# run: | | ||
# npm link | ||
# zx-extra https://raw.githubusercontent.com/semrel-extra/zx-semrel/0df9ee72ccaddae156e821a340806d49307b963c/release.mjs | ||
- name: Run tests | ||
timeout-minutes: 2 | ||
run: bun test:bun |
Oops, something went wrong.