always save cache #274
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches-ignore: ['all-contributors/**'] | |
pull_request: | |
branches-ignore: ['all-contributors/**'] | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
if: > | |
github.event_name != 'pull_request' || | |
github.event.pull_request.head.repo.fork | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
- id: restore | |
name: β»οΈ Restore node_modules | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
yarn.lock | |
node_modules | |
key: ${{ runner.os }}-${{ hashFiles('package.json') }} | |
- id: install | |
if: > | |
steps.restore.outputs.cache-hit != 'true' | |
name: π₯ Install deps | |
run: yarn | |
env: | |
HUSKY_SKIP_INSTALL: true | |
- if: > | |
steps.install.outcome == 'success' | |
name: β»οΈ Save node_modules | |
uses: actions/cache/save@v4 | |
with: | |
path: | | |
yarn.lock | |
node_modules | |
key: ${{ steps.restore.outputs.cache-primary-key }} | |
- name: β Lint | |
run: npm run lint | |
- name: π§ͺ Test | |
run: npm run test -- --coverage | |
- name: π§ Build test environments | |
run: npm run setup:env | |
- name: π¬ Test with toolbox | |
run: npm run test:toolbox | |
- name: π Build | |
run: npm run build | |
- name: βοΈ Upload coverage report | |
uses: codecov/codecov-action@v5 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
release: | |
needs: validate | |
runs-on: ubuntu-latest | |
if: > | |
github.event_name == 'push' && github.repository == | |
'testing-library/user-event' && | |
contains('refs/heads/main,refs/heads/beta,refs/heads/alpha', github.ref) | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
- name: β»οΈ Restore node_modules | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
yarn.lock | |
node_modules | |
key: ${{ runner.os }}-${{ hashFiles('package.json') }} | |
- name: π₯ Install deps | |
run: yarn | |
env: | |
HUSKY_SKIP_INSTALL: true | |
- name: ποΈ Run build script | |
run: npm run build | |
- name: π Release | |
uses: ph-fritsche/action-release@v2 | |
with: | |
dry: ${{ vars.RELEASE_DRY }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |