Merge pull request #51 from cesarhenrq/qa #80
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: unit-lint-typecheck-e2e-ct | |
on: | |
push: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
install-dependencies: | |
name: Install Dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
# Note: when wanting to cache Cypress as well as node_modules, use cypress-io/github-action | |
# with it, there is no need to setup node, and Cypress is cached. | |
# if it's a non-Cypress install, use bahmutov/npm-install | |
# - uses: actions/setup-node@v3 | |
# with: | |
# cache: 'yarn' | |
# node-version: 16.10.0 | |
# - uses: bahmutov/[email protected] | |
# with: {useRollingCache: true} # recommended for large projects | |
# env: | |
# CYPRESS_INSTALL_BINARY: 0 # no need to install the Cypress binary, we are already using the docker image in the e2e job | |
# Install NPM dependencies, cache node-modules and Cypress correctly | |
# https://github.com/cypress-io/github-action | |
- name: Install dependencies | |
uses: cypress-io/[email protected] | |
with: | |
runTests: false | |
unit-test: | |
needs: [install-dependencies] | |
name: Run Unit Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
# - uses: bahmutov/[email protected] | |
# with: {useRollingCache: true} | |
# env: | |
# CYPRESS_INSTALL_BINARY: 0 | |
- name: Install dependencies | |
uses: cypress-io/[email protected] | |
with: | |
runTests: false | |
- name: unit-test | |
run: yarn test:coverage | |
# if you want to enable codecov | |
# - name: Upload artifacts | |
# uses: actions/[email protected] | |
# with: | |
# name: coverage | |
# path: coverage/ | |
# retention-days: 1 | |
# - name: ✅ Upload Jest coverage to Codecov | |
# uses: codecov/codecov-action@v3 | |
# with: | |
# directory: coverage/ | |
# flags: unit-test-coverage | |
# token: ${{ secrets.CODECOV_TOKEN }} | |
lint: | |
needs: install-dependencies | |
name: Run Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
# - uses: bahmutov/[email protected] | |
# with: {useRollingCache: true} | |
# env: | |
# CYPRESS_INSTALL_BINARY: 0 | |
- name: Install dependencies | |
uses: cypress-io/[email protected] | |
with: | |
runTests: false | |
- name: lint | |
run: yarn lint | |
typecheck: | |
needs: install-dependencies | |
name: Run typecheck | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
# - uses: bahmutov/[email protected] | |
# with: {useRollingCache: true} | |
# env: | |
# CYPRESS_INSTALL_BINARY: 0 | |
- name: Install dependencies | |
uses: cypress-io/[email protected] | |
with: | |
runTests: false | |
- name: typecheck | |
run: yarn typecheck | |
cypress-e2e-test: | |
# if you want to enable parallelization | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# machines: [1, 2] | |
needs: [install-dependencies] | |
runs-on: ubuntu-latest | |
# container: cypress/included:10.11.0 # no need when using cypress gha to install dependencies | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
# - uses: bahmutov/[email protected] # save time on dependencies | |
# with: {useRollingCache: true} | |
- name: Cypress e2e tests 🧪 | |
uses: cypress-io/[email protected] | |
with: | |
# install: false # Cypress gha will take care of install instead of bahmutov/installs | |
start: yarn start | |
wait-on: 'http://localhost:3000' | |
browser: chrome | |
# if you want to enable parallelization | |
# record: true | |
# parallel: true | |
# group: e2e-tests | |
# tag: e2e-tests | |
env: | |
# if you want to enable parallelization | |
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# if you want to enable codecov | |
# - name: Upload artifacts (Coverage_step3) | |
# uses: actions/[email protected] | |
# with: | |
# name: coverage-cy-e2e | |
# path: coverage-cy/ | |
# retention-days: 1 | |
# - name: ✅ Upload e2e coverage to Codecov | |
# uses: codecov/codecov-action@v3 | |
# with: | |
# directory: coverage-cy/ | |
# flags: cypress-e2e-coverage | |
# token: ${{ secrets.CODECOV_TOKEN }} | |
cypress-ct-test: | |
# if you want to enable parallelization | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# machines: [1, 2, 3] | |
needs: [install-dependencies] | |
runs-on: ubuntu-latest | |
# container: cypress/included:10.11.0 # no need when using cypress gha to install dependencies | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
# - uses: bahmutov/[email protected] # save time on dependencies | |
# with: {useRollingCache: true} | |
- name: Cypress component tests 🧪 | |
uses: cypress-io/[email protected] | |
with: | |
# we have already installed everything | |
# install: false # Cypress gha will take care of caching instead of bahmutov/installs | |
component: true | |
browser: chrome | |
# if you want to enable parallelization | |
# record: true | |
# parallel: true | |
# group: ct-tests | |
# tag: ct-tests | |
env: | |
# if you want to enable parallelization | |
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# if you want to enable codecov | |
# - name: Upload artifacts (Coverage_step3) | |
# uses: actions/[email protected] | |
# with: | |
# name: coverage-cy-ct | |
# path: coverage-cy/ | |
# retention-days: 1 | |
# - name: ✅ Upload CT coverage to Codecov | |
# uses: codecov/codecov-action@v3 | |
# with: | |
# directory: coverage-cy/ | |
# flags: cypress-ct-coverage | |
# token: ${{ secrets.CODECOV_TOKEN }} |