try something #17
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: ["main"] | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [ 16, 18 ] | |
steps: | |
# https://dev.to/drakulavich/aggressive-dependency-caching-in-github-actions-3c64 | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'npm' | |
- name: Install Dependencies | |
run: npm install | |
# Linter should catches these??? and Lint --Fix should fix them | |
# - name: Format Check | |
# run: npm run lint | |
- name: Lint | |
run: npm run lint | |
- name: Build | |
run: npm run build | |
test-site: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Cypress | |
uses: cypress-io/github-action@v5 | |
with: | |
runTests: false | |
# https://glebbahmutov.com/blog/test-monorepo-apps/ | |
# https://www.thisdot.co/blog/utilizing-cypress-testing-in-a-multi-app-monorepo/ | |
- name: Cypress Run | |
uses: cypress-io/github-action@v5 | |
with: | |
install: false | |
project: apps/site | |
start: npm run dev | |
# can we just cache node modules nad all build artifacts... download them all | |
# run cypress from a container instead per app in their own jobs? |