Lint, Build, Test #195
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
# 1) Checkoput, install Node.js, Turborepo CLI, deps and Lint | |
# 2a) Build | |
# 2b) Test | |
name: Push to any | |
run-name: Lint, Build, Test | |
on: | |
# push: | |
# branches-ignore: | |
# - main | |
workflow_dispatch: | |
env: | |
# To use Remote Caching, uncomment the next lines and follow the steps below. | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
TURBO_REMOTE_ONLY: true | |
jobs: | |
checkout_install_lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 2 | |
- name: Install Node.js v20.10 | |
uses: actions/[email protected] | |
with: | |
node-version: '20.10' | |
- name: Get node version | |
id: node | |
run: | | |
echo "::set-output name=version::$(node -v)" | |
- name: Get node_modules cache | |
uses: actions/[email protected] | |
# id: node_modules | |
with: | |
path: | | |
**/node_modules | |
# Adding node version as cache key | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }} | |
- name: Install TurboRepo CLI | |
run: yarn global add turbo | |
- name: Install dependencies | |
run: yarn | |
- name: Lint | |
# run: turbo run lint --filter="...[HEAD^1]" | |
run: turbo run lint | |
build: | |
runs-on: ubuntu-latest | |
needs: checkout_install_lint | |
steps: | |
- name: Build | |
run: | | |
# yarn workspaces foreach --verbose --since --no-private info | |
# yarn workspaces info | |
# yarn workspaces foreach install | |
# turbo run build --filter="...[HEAD^1]" | |
turbo run build | |
test: | |
runs-on: ubuntu-latest | |
needs: checkout_install_lint | |
steps: | |
- name: Install TurboRepo CLI | |
run: yarn global add turbo | |
- name: Test | |
run: | | |
# turbo run test --filter=...[origin/main] | |
# turbo run test | |
turbo run lint |