Allow GitHub workflows to use other Yarn versions #114
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: Test API | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'api/**.ts' | |
- 'api/config.json' | |
- 'api/tsconfig.json' | |
- 'api/package.json' | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
working-directory: ./api | |
defaults: | |
run: | |
working-directory: ${{ env.working-directory }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 19 | |
- name: Install dependencies | |
run: | | |
yarn set version berry | |
yarn cache clean | |
export YARN_ENABLE_IMMUTABLE_INSTALLS=false | |
yarn install | |
- name: Run tests | |
run: | | |
yarn retest | |