-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Unify workflows into singular pipeline (#4520)
* ci: Remove duplicate build & test job in CI * ci: Wait for filter * ci: Missing `runs-on` * junk: REVERT ME - To trigger CI * ci: Fix action name & format * ci: Fix wrong job name * junk: REVERT ME - Fixes workflow test * ci: Further refactor into singular pipeline * ci: Better name for filter * ci: Fix workflow name * ci: Clean up
- Loading branch information
1 parent
ad3bc3b
commit b5bdcef
Showing
5 changed files
with
86 additions
and
70 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
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,55 @@ | ||
name: Build & Test | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
description: 'Branch or tag ref to check out' | ||
type: string | ||
required: false | ||
default: '' | ||
artifact_name: | ||
description: 'Name of the artifact to upload' | ||
type: string | ||
required: false | ||
default: 'npm-package' | ||
|
||
jobs: | ||
build_test: | ||
name: Build & Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref || '' }} | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: 'package.json' | ||
cache: 'npm' | ||
cache-dependency-path: '**/package-lock.json' | ||
- run: npm ci | ||
- name: test | ||
env: | ||
CI: true | ||
COVERAGE: true | ||
FLAKEY: false | ||
# Not using `npm test` since it rebuilds source which npm ci has already done | ||
run: | | ||
npm run lint | ||
npm run test:unit | ||
- name: Coveralls GitHub Action | ||
uses: coverallsapp/[email protected] | ||
timeout-minutes: 2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Package | ||
# Use --ignore-scripts here to avoid re-building again before pack | ||
run: | | ||
npm pack --ignore-scripts | ||
mv preact-*.tgz preact.tgz | ||
- name: Upload npm package | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact_name || 'npm-package' }} | ||
path: preact.tgz |
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 |
---|---|---|
|
@@ -2,61 +2,41 @@ name: CI | |
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
description: 'Branch or tag ref to check out' | ||
type: string | ||
required: false | ||
default: '' | ||
artifact_name: | ||
description: 'Name of the artifact to upload' | ||
type: string | ||
required: false | ||
default: 'npm-package' | ||
pull_request: | ||
branches: | ||
- '**' | ||
push: | ||
branches: | ||
- main | ||
- restructure | ||
- v11 | ||
|
||
jobs: | ||
build_test: | ||
name: Build & Test | ||
filter_jobs: | ||
name: Filter jobs | ||
runs-on: ubuntu-latest | ||
outputs: | ||
jsChanged: ${{ steps.filter.outputs.jsChanged }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref || '' }} | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: 'package.json' | ||
cache: 'npm' | ||
cache-dependency-path: '**/package-lock.json' | ||
- run: npm ci | ||
- name: test | ||
env: | ||
CI: true | ||
COVERAGE: true | ||
FLAKEY: false | ||
# Not using `npm test` since it rebuilds source which npm ci has already done | ||
run: | | ||
npm run lint | ||
npm run test:unit | ||
- name: Coveralls GitHub Action | ||
uses: coverallsapp/[email protected] | ||
timeout-minutes: 2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Package | ||
# Use --ignore-scripts here to avoid re-building again before pack | ||
run: | | ||
npm pack --ignore-scripts | ||
mv preact-*.tgz preact.tgz | ||
- name: Upload npm package | ||
uses: actions/upload-artifact@v4 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
name: ${{ inputs.artifact_name || 'npm-package' }} | ||
path: preact.tgz | ||
filters: | | ||
jsChanged: '**/src/**.js' | ||
compressed_size: | ||
name: Compressed Size | ||
needs: filter_jobs | ||
if: ${{ needs.filter_jobs.outputs.jsChanged == 'true' }} | ||
uses: ./.github/workflows/size.yml | ||
|
||
build_test: | ||
name: Build & Test | ||
needs: filter_jobs | ||
uses: ./.github/workflows/build-test.yml | ||
|
||
benchmarks: | ||
name: Benchmarks | ||
needs: build_test | ||
if: ${{ needs.filter_jobs.outputs.jsChanged == 'true' }} | ||
uses: ./.github/workflows/benchmarks.yml |
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