docs: refine #6
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: Machinomy CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_DB: machinomy_test | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd="pg_isready -U postgres" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=5 | |
env: | |
PGUSER: postgres | |
PGDATABASE: machinomy_test | |
NODE_ENV: test | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install Yarn v4 | |
run: npm install -g yarn@berry | |
- name: Configure Yarn v4 | |
run: yarn set version berry | |
- name: Add Yarn to PATH | |
run: echo "$HOME/.yarn/bin" >> $GITHUB_PATH | |
- name: Install global dependencies | |
run: | | |
yarn dlx codecov | |
- name: Install dependencies | |
run: | | |
yarn | |
- name: Set up PostgreSQL | |
run: | | |
psql -c 'create database machinomy_test;' -U postgres -d postgres | |
psql -c "create user testuser with password 'testpassword' createdb;" -U postgres | |
PGPASSWORD='testpassword' psql -c 'create database testdb;' -U testuser -d postgres | |
- name: Lint code | |
run: yarn run lint | |
- name: Build project | |
run: yarn run build | |
- name: Run tests | |
run: yarn run test | |
- name: Generate coverage report | |
run: yarn run coverage | |
- name: Upload coverage to Codecov | |
run: bash <(curl -s https://codecov.io/bash) -s packages -t ${{ secrets.CODECOV_TOKEN }} |