-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: make the upload to codecov run only if tests pass
- Loading branch information
1 parent
14cfe3f
commit 617db3f
Showing
3 changed files
with
89 additions
and
77 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,58 @@ | ||
name: 🧹 Pull request | ||
name: 🧹 Lint & changelog | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
syntax_changelog: | ||
name: Syntax & changelog | ||
lint: | ||
name: Lint code | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .nvmrc | ||
|
||
- name: Install | ||
- name: Install dependencies | ||
run: node common/scripts/install-run-rush.js install | ||
|
||
- name: 🏗 Build | ||
- name: Build application | ||
run: node common/scripts/install-run-rush.js rebuild | ||
|
||
- name: 📝 Verify missing changelogs | ||
run: node common/scripts/install-run-rush.js change --target-branch origin/$GITHUB_BASE_REF --verify -v | ||
|
||
- name: 💅 Lint | ||
- name: Lint code | ||
# --verbose allows to display warnings from ESLint | ||
run: node common/scripts/install-run-rush.js lint --verbose | ||
|
||
test: | ||
name: Test | ||
changelog: | ||
name: Checks for changelogs | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
defaults: | ||
run: | ||
shell: bash | ||
strategy: | ||
matrix: | ||
node_version: [18, 19, 20, 21] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- uses: actions/setup-node@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
node-version-file: .nvmrc | ||
|
||
- name: Install | ||
- name: Install dependencies | ||
run: node common/scripts/install-run-rush.js install | ||
|
||
- name: 🏗 Build | ||
run: node common/scripts/install-run-rush.js rebuild | ||
|
||
- name: 🐛 Test | ||
run: node common/scripts/install-run-rush.js test | ||
- name: Checks for changelogs | ||
run: node common/scripts/install-run-rush.js change --target-branch origin/$GITHUB_BASE_REF --verify -v |
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,67 @@ | ||
name: 🐛 Test | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
defaults: | ||
run: | ||
shell: bash | ||
strategy: | ||
matrix: | ||
node_version: [18, 19, 20, 21] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
|
||
- name: Install | ||
run: node common/scripts/install-run-rush.js install | ||
|
||
- name: Build | ||
run: node common/scripts/install-run-rush.js rebuild | ||
|
||
- name: Test | ||
if: ${{ matrix.node != 18 }} | ||
run: node common/scripts/install-run-rush.js test | ||
|
||
- name: Test and generate coverage reports | ||
if: ${{ matrix.node == 18 }} | ||
run: node common/scripts/install-run-rush.js test --coverage | ||
|
||
- name: Archive code coverage reports | ||
if: ${{ matrix.node == 18 }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: code-coverage-reports | ||
path: modules/**/clover.xml | ||
retention-days: 1 | ||
|
||
coverage: | ||
name: Upload code coverage reports to Codecov | ||
runs-on: ubuntu-latest | ||
needs: test | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- name: Download reports from previous job | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: code-coverage-reports | ||
|
||
- name: Upload reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
fail_ci_if_error: true |