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: Lint, Test, and Build in Parallel | ||
on: [push] | ||
jobs: | ||
setup-cache: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
cache-key: ${{ steps.cache-keys.outputs.cache-key }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'yarn' | ||
- name: Generate cache key | ||
id: cache-keys | ||
run: | | ||
CACHE_DIR=$(yarn cache dir) | ||
echo "Cache directory: $CACHE_DIR" | ||
mkdir -p $CACHE_DIR | ||
echo "::set-output name=cache-key::$CACHE_DIR" | ||
lint: | ||
needs: setup-cache | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'yarn' | ||
cache-dependency-path: ${{ needs.setup-cache.outputs.cache-key }} | ||
- name: Lint | ||
run: yarn lint | ||
test: | ||
needs: setup-cache | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'yarn' | ||
cache-dependency-path: ${{ needs.setup-cache.outputs.cache-key }} | ||
- name: Run Tests | ||
run: yarn test:all | ||
build: | ||
needs: setup-cache | ||
runs | ||