back button #307
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: OBP CI/CD - Linter, Prettier, Test, Build | |
on: | |
push: | |
branches: | |
- '*' | |
- '!main' | |
- '!develop' | |
workflow_dispatch: | |
jobs: | |
install_packages: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set-up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install Node.js packages | |
run: npm ci | |
prettier: | |
needs: install_packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set-up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install Node.js packages | |
run: npm ci | |
- name: Run Prettier | |
run: npm run prettier:check | |
linter: | |
needs: install_packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set-up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install Node.js packages | |
run: npm ci | |
- name: Run linter | |
run: npm run lint | |
test: | |
needs: [prettier, linter] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set-up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install Node.js packages | |
run: npm ci | |
- name: Run tests | |
run: npm run test:ci | |
build: | |
needs: [prettier, linter] | |
runs-on: ubuntu-latest | |
env: | |
NODE_OPTIONS: --max-old-space-size=7168 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set-up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install Node.js packages | |
run: npm ci | |
- name: Build app | |
run: npm run build |