This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
feat: Enable StatelessNet network #3788
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: | |
push: | |
branches: | |
- master | |
jobs: | |
prettier: | |
name: Prettier | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-node | |
- uses: ./.github/actions/install-packages | |
- name: Run code formatting check | |
run: npm run prettier | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-node | |
- uses: ./.github/actions/install-packages | |
- name: Run lint check | |
run: npm run lint | |
frontend-typecheck: | |
name: Frontend typecheck | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-node | |
- uses: ./.github/actions/install-packages | |
- name: Run typecheck | |
run: npm run -w frontend typecheck | |
frontend-build: | |
name: Build frontend | |
needs: frontend-typecheck | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-node | |
- uses: ./.github/actions/install-packages | |
- name: Build frontend | |
run: STATS=true npm run -w frontend build | |
- name: Upload frontend build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: frontend-dist | |
if-no-files-found: error | |
path: frontend/.next/ | |
- uses: ./.github/actions/upload-frontend-stats | |
with: | |
name: pr-stats | |
frontend-build-base: | |
name: Build frontend base | |
runs-on: ubuntu-latest | |
if: github.ref != 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.base_ref }} | |
- uses: ./.github/actions/setup-node | |
- uses: ./.github/actions/install-packages | |
- name: Build frontend | |
run: STATS=true npm run -w frontend build | |
- uses: ./.github/actions/upload-frontend-stats | |
with: | |
name: base-stats | |
backend-typecheck: | |
name: Backend typecheck | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-node | |
- uses: ./.github/actions/install-packages | |
- name: Run typecheck | |
run: npm run -w backend typecheck | |
backend-build: | |
name: Build backend | |
needs: backend-typecheck | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-node | |
- uses: ./.github/actions/install-packages | |
- name: Build backend | |
run: npm run -w backend build | |
- name: Upload backend build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: backend-dist | |
path: backend/build/ | |
frontend-test: | |
name: Frontend unit testing | |
needs: frontend-build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-node | |
- uses: ./.github/actions/install-packages | |
- name: Run unit tests | |
run: npm run -w frontend test -- --updateSnapshot | |
e2e-test: | |
name: e2e testing | |
needs: [frontend-build, backend-build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-node | |
- uses: ./.github/actions/install-packages | |
- name: Install Playwright | |
run: npx playwright install --with-deps | |
- name: Download frontend dist | |
uses: actions/download-artifact@v3 | |
with: | |
name: frontend-dist | |
path: frontend/.next/ | |
- name: Download backend dist | |
uses: actions/download-artifact@v3 | |
with: | |
name: backend-dist | |
path: backend/build/ | |
- name: Run Playwright tests | |
# Running npm run -w frontend test:e2e yields 0 exit code on fail | |
# on Github Actions for some reason, so we have to use non-workspace version | |
run: npm run test:e2e | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: frontend/playwright-report/ | |
retention-days: 30 | |
backend-database-types-check: | |
name: Backend database types check | |
needs: backend-typecheck | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-node | |
- uses: ./.github/actions/install-packages | |
- name: Copy original models | |
run: cp -r backend/src/database/models backend/src/database/models-original | |
- name: Generate types | |
run: npm run -w backend db:update-types | |
- name: Compare types | |
run: diff -bur backend/src/database/models-original backend/src/database/models | |
report: | |
name: Generate stats report | |
runs-on: ubuntu-latest | |
needs: [frontend-build, frontend-build-base] | |
if: github.ref != 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download base stats | |
uses: actions/download-artifact@v3 | |
with: | |
name: base-stats | |
path: stats/base | |
- name: Download PR stats | |
uses: actions/download-artifact@v3 | |
with: | |
name: pr-stats | |
path: stats/pr | |
- name: Get client diff | |
id: get-client-diff | |
uses: NejcZdovc/bundle-size-diff@v1 | |
with: | |
base_path: "./stats/base/stats.json" | |
pr_path: "./stats/pr/stats.json" | |
- name: Get server diff | |
id: get-server-diff | |
uses: NejcZdovc/bundle-size-diff@v1 | |
with: | |
base_path: "./stats/base/server/chunks/stats.json" | |
pr_path: "./stats/pr/server/chunks/stats.json" | |
- name: Comment | |
uses: NejcZdovc/[email protected] | |
with: | |
file: "comment.md" | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
SERVER_OLD: ${{ steps.get-server-diff.outputs.base_file_string }} | |
SERVER_NEW: ${{ steps.get-server-diff.outputs.pr_file_string }} | |
SERVER_DIFF: ${{ steps.get-server-diff.outputs.diff_file_string }} | |
SERVER_DIFF_PERCENT: ${{ steps.get-server-diff.outputs.percent }} | |
CLIENT_OLD: ${{ steps.get-client-diff.outputs.base_file_string }} | |
CLIENT_NEW: ${{ steps.get-client-diff.outputs.pr_file_string }} | |
CLIENT_DIFF: ${{ steps.get-client-diff.outputs.diff_file_string }} | |
CLIENT_DIFF_PERCENT: ${{ steps.get-client-diff.outputs.percent }} |