Skip to content

Commit

Permalink
chore: add "smoke-text/examples" workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed Nov 2, 2023
1 parent dff7fac commit fb5ca95
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/smoke-test.yml
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

0 comments on commit fb5ca95

Please sign in to comment.