-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explore unified CI for packages using NX's affected command
- Loading branch information
1 parent
93baabc
commit 1a5d3e7
Showing
10 changed files
with
114 additions
and
15 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,82 @@ | ||
name: 'Packages CI' | ||
|
||
on: | ||
push: | ||
paths: | ||
- packages/** | ||
- .github/workflows/packages_ci.yml | ||
- jest.config.ts | ||
- jest.preset.js | ||
- .eslintrc.json | ||
- .prettierrc | ||
- package.json | ||
- package-lock.json | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.4.0' | ||
|
||
- name: Install dependencies | ||
run: | | ||
make install/ci | ||
- name: Code format | ||
shell: bash | ||
run: | | ||
npx nx affected --target format:check | ||
npx nx affected --target lint:check | ||
test-type: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
steps: | ||
- shell: bash | ||
run: | | ||
npx nx affected --target test:type | ||
test-unit: | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- shell: bash | ||
run: | | ||
npx nx affected --target test:unit | ||
# test-integration: | ||
# needs: [build] | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - shell: bash | ||
# run: | | ||
# npx nx affected --target test:integration | ||
|
||
# test-e2e: | ||
# needs: [build] | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - shell: bash | ||
# run: | | ||
# npx nx affected --target test:e2e | ||
|
||
notify: | ||
needs: [test-type, test-unit, test-integration, test-e2e] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send Slack notification on failure | ||
if: failure() && github.ref == 'refs/heads/main' | ||
uses: 8398a7/action-slack@v3 | ||
with: | ||
username: GitHub | ||
author_name: '@narval/transaction-request-intent CI failed' | ||
status: ${{ job.status }} | ||
fields: message,commit,author | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
TRI_PROJECT_NAME := signature-verifier | ||
TRI_PROJECT_DIR := ./packages/signature-verifier | ||
SIGNATURE_PROJECT_NAME := signature-verifier | ||
SIGNATURE_PROJECT_DIR := ./packages/signature-verifier | ||
|
||
# == Code format == | ||
|
||
signature-verifier/format: | ||
npx nx format:write --projects ${TRI_PROJECT_NAME} | ||
npx nx format:write --projects ${SIGNATURE_PROJECT_NAME} | ||
|
||
signature-verifier/lint: | ||
npx nx lint ${TRI_PROJECT_NAME} -- --fix | ||
npx nx lint ${SIGNATURE_PROJECT_NAME} -- --fix | ||
|
||
signature-verifier/format/check: | ||
npx nx format:check --projects ${TRI_PROJECT_NAME} | ||
npx nx format:check --projects ${SIGNATURE_PROJECT_NAME} | ||
|
||
signature-verifier/lint/check: | ||
npx nx lint ${TRI_PROJECT_NAME} | ||
npx nx lint ${SIGNATURE_PROJECT_NAME} | ||
|
||
# == Testing == | ||
|
||
signature-verifier/test/type: | ||
npx tsc \ | ||
--project ${TRI_PROJECT_DIR}/tsconfig.lib.json \ | ||
--project ${SIGNATURE_PROJECT_DIR}/tsconfig.lib.json \ | ||
--noEmit | ||
|
||
signature-verifier/test/unit: | ||
npx nx test:unit ${TRI_PROJECT_NAME} -- ${ARGS} | ||
npx nx test:unit ${SIGNATURE_PROJECT_NAME} -- ${ARGS} | ||
|
||
signature-verifier/test/unit/watch: | ||
make signature-verifier/test/unit ARGS=--watch |
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
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