Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate to pnpm; bumping dependencies; improving ci #57

Merged
merged 8 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 40 additions & 46 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,32 @@ concurrency:
cancel-in-progress: true

jobs:
build:
name: Build
build-and-lint:
name: Build and Lint
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
node-version: 18
scope: "@subtopia-algo"
cache: "npm"
cache-dependency-path: ./package-lock.json

- name: Install dependencies
run: npm ci

- name: Run build
run: npm run build

lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
version: 9
run_install: true

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
scope: "@subtopia-algo"
cache: "npm"
cache-dependency-path: ./package-lock.json
cache: "pnpm"
cache-dependency-path: ./pnpm-lock.yaml

- name: Install dependencies
run: npm ci
- name: Run build
run: pnpm run build

- name: Lint
run: npm run lint:scripts
run: pnpm run lint:scripts

unit-tests:
name: Integration tests
Expand All @@ -79,23 +64,26 @@ jobs:
python-version: ">=3.11 <3.12"
poetry-version: 1.7.1

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: true

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
scope: "@subtopia-algo"
cache: "npm"
cache-dependency-path: ./package-lock.json

- name: Install dependencies
run: npm ci
cache: "pnpm"
cache-dependency-path: ./pnpm-lock.yaml

- name: Run tests
run: npm run test:integration
run: pnpm run test:integration

- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
if: runner.os == 'Linux' && matrix.node == '18'
if: runner.os == 'Linux' && matrix.node == '20'
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -104,12 +92,18 @@ jobs:
if: github.ref == 'refs/heads/release'
permissions: write-all
name: Deploy docs
needs: [build, lint, unit-tests]
needs: [build-and-lint, unit-tests]
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: true

- name: Setup node
uses: actions/setup-node@v4
with:
Expand All @@ -118,11 +112,8 @@ jobs:
cache: "npm"
cache-dependency-path: ./package-lock.json

- name: Install dependencies
run: npm ci

- name: Build docs
run: npm run docs
run: pnpm run docs

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
Expand All @@ -135,7 +126,7 @@ jobs:
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/release'
permissions: write-all
name: Release
needs: [build, lint, unit-tests]
needs: [build-and-lint, unit-tests]
runs-on: ubuntu-latest
steps:
- name: Check out repository
Expand All @@ -144,22 +135,25 @@ jobs:
fetch-depth: 0
persist-credentials: false # <--- override default gh token

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: true

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
scope: "@subtopia-algo"
cache: "npm"
cache-dependency-path: ./package-lock.json

- name: Install dependencies
run: npm ci
cache: "pnpm"
cache-dependency-path: ./pnpm-lock.yaml

- name: Run build
run: npm run build
run: pnpm run build

- name: release
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run release
run: pnpm run release
Loading
Loading