Skip to content

Commit

Permalink
Test built package artifact in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Feb 26, 2023
1 parent 50d47cd commit aacb6de
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
filters: |
toolkit:
- 'packages/toolkit/**'
- 'examples/publish-ci/**'
- '.github/workflows/tests.yml'
build:
needs: changes
Expand Down Expand Up @@ -127,3 +129,49 @@ jobs:
run: |
yarn tsc --version
yarn type-tests
test-published-artifact:
name: Test Published Artifact ${{ matrix.example }}

needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['16.x']
example: ['cra5']
defaults:
run:
working-directory: ./examples/publish-ci/${{ matrix.example }}
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Install deps
run: yarn install

- name: Remove existing RTK
run: yarn remove @reduxjs/toolkit

- uses: actions/download-artifact@v2
with:
name: package
path: ./examples/publish-ci/${{ matrix.example }}

- name: Check folder contents
run: ls -l .

- name: Install RTK build artifact
run: yarn add ./package.tgz

- name: Build example
run: yarn build

- name: Run Playwright test
run: yarn test
3 changes: 1 addition & 2 deletions examples/publish-ci/cra5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"serve-app": "yarn serve -s build",
"test-playwright": "yarn playwright test",
"test": "yarn playwright test",
"format": "prettier --write \"./src/**/*.{ts,tsx}\" \"**/*.md\""
},
"eslintConfig": {
Expand Down

0 comments on commit aacb6de

Please sign in to comment.