ci/cd: gains GH action to automate checks and tests #3
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: CI | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
setup: | |
name: Install Node and Dependencies | |
runs-on: ubuntu-latest | |
outputs: | |
node_version: ${{ steps.node_version.outputs.node-version }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
id: node_version | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.18.2' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
unit_tests: | |
name: Run Unit Tests | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Run Unit Tests | |
run: npm run test:unit | |
integration_tests: | |
name: Run Integration Tests | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download Browser | |
run: npx playwright install | |
- name: Run Integration Tests | |
run: npm run test:integration | |
lint: | |
name: Run Linting | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Run Linting | |
run: npm run lint | |
type_check: | |
name: Run Type Checking | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Run Type Checking | |
run: npm run check |