-
-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add "smoke-text/examples" workflow
- Loading branch information
1 parent
dff7fac
commit fb5ca95
Showing
1 changed file
with
60 additions
and
0 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,60 @@ | ||
name: smoke-test | ||
|
||
on: | ||
# Always run smoke tests upon a successful | ||
# "ci" job completion on "main". | ||
workflow_run: | ||
workflows: ['ci'] | ||
branches: [main] | ||
types: [completed] | ||
# Also allow on-demand smoke test runs. | ||
# Useful when testing a particular branch | ||
# for compatibility with the examples. | ||
workflow_dispatch: | ||
|
||
jobs: | ||
examples: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout | ||
use: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
use: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Set up PNPM | ||
use: pnpm/action-setup@v2 | ||
with: | ||
version: 7.12 | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Override package.json version | ||
run: | | ||
COMMIT_HASH=$(git rev-parse HEAD) | ||
echo "Latest commit: $COMMIT_HASH" | ||
sed -i "s/version/REPLA/" package.json | ||
- name: Pack | ||
run: pnpm pack | ||
|
||
- name: Clone examples | ||
run: git clone git@github.com:mswjs/examples.git | ||
|
||
- name: Install example dependencies | ||
working_directory: ./examples | ||
run: pnpm install | ||
|
||
- name: Link MSW build | ||
working_directory: ./examples | ||
run: | | ||
pnpm link ../msw-$COMMIT_HASH.tgz | ||
pnpm ls msw | ||
- name: Tests | ||
working_directory: ./examples | ||
run: pnpm test |