Updated example code #73
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: Test | |
on: | |
push: | |
branches: | |
- '*' | |
- '!main' | |
pull_request: | |
branches: | |
- '*' | |
- '!main' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Get yarn version | |
run: echo "yarn_version=$(yarn -v)" >> $GITHUB_ENV | |
- name: Get yarn(v1) cache directory path | |
if: startsWith(env.yarn_version, '1') | |
run: echo "cache_dir=$(yarn cache dir)" >> $GITHUB_ENV | |
- name: Get yarn(v2) cache directory path | |
if: startsWith(env.yarn_version, '2') | |
run: echo "cache_dir=$(yarn config get cacheFolder)" | |
- name: Cache Node.js modules | |
id: yarn-cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.cache_dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn --frozen-lockfile | |
- run: yarn build | |
- run: yarn test |