Handle null people in pairing history #72
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 Pipeline | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
node_version: ${{ steps.nvmrc.outputs.NODE_VERSION }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Read Node.js version from .nvmrc | |
id: nvmrc | |
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV && echo "::set-output name=NODE_VERSION::$(cat .nvmrc)" | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} | |
- name: Cache node modules | |
id: cache-node-modules | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ steps.nvmrc.outputs.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ steps.nvmrc.outputs.NODE_VERSION }}- | |
- name: Install dependencies | |
run: npm install | |
- name: Compress node_modules | |
run: tar -czf node_modules.tar.gz node_modules | |
- name: Save node_modules | |
uses: actions/upload-artifact@v4 | |
with: | |
name: node-modules | |
path: node_modules.tar.gz | |
unit-tests: | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ needs.setup.outputs.node_version }} | |
- name: Download and decompress node_modules | |
uses: actions/download-artifact@v4 | |
with: | |
name: node-modules | |
path: . | |
- run: tar -xzf node_modules.tar.gz | |
- name: Run unit tests | |
run: npm test | |
lint: | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ needs.setup.outputs.node_version }} | |
- name: Download and decompress node_modules | |
uses: actions/download-artifact@v4 | |
with: | |
name: node-modules | |
path: . | |
- run: tar -xzf node_modules.tar.gz | |
- name: Lint code | |
run: npm run lint | |
build: | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ needs.setup.outputs.node_version }} | |
- name: Download and decompress node_modules | |
uses: actions/download-artifact@v4 | |
with: | |
name: node-modules | |
path: . | |
- run: tar -xzf node_modules.tar.gz | |
- name: Build project | |
run: npm run build |