Skip to content

[MPDX-9214] Show progressive approval tier #8479

[MPDX-9214] Show progressive approval tier

[MPDX-9214] Show progressive approval tier #8479

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
workflow_dispatch:
env:
# Normally, we want to use production API for codegen to make sure production is compatible with
# the code to be merged. However, sometimes GraphQL queries or mutations are only available in
# staging and haven't been merged to production yet. In that case, we still want CI to run, but
# we don't want to let the PR be merged yet. If the "Staging API" label is added to the PR, we
# run codegen against the staging API instead of the production API and block the PR from merging.
API_URL: ${{ contains(github.event.pull_request.labels.*.name, 'Staging API') && 'https://api.stage.mpdx.org/graphql' || 'https://api.mpdx.org/graphql' }}
SITE_URL: http://stage.mpdx.org
jobs:
test:
runs-on: ubuntu-latest
name: test (chunk ${{ matrix.chunk }})
strategy:
matrix:
chunk:
[
1/12,
2/12,
3/12,
4/12,
5/12,
6/12,
7/12,
8/12,
9/12,
10/12,
11/12,
12/12,
]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
- name: 📦 Install Dependencies
# Download packages from the registry instead of git-lfs to save git-lfs bandwidth
run: yarn cache clean && yarn install
- name: 📈 Run GraphQL Codegen
uses: nick-fields/retry@v3
with:
command: yarn gql
timeout_minutes: 1
retry_wait_seconds: 60
max_attempts: 2
- name: 🧪 Test (chunk ${{ matrix.chunk }})
run: yarn test:coverage --ci --shard ${{ matrix.chunk }}
- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
- name: 📦 Install Dependencies
# Download packages from the registry instead of git-lfs to save git-lfs bandwidth
run: yarn cache clean && yarn install
- name: 📈 Run GraphQL Codegen
uses: nick-fields/retry@v3
with:
command: yarn gql
timeout_minutes: 1
retry_wait_seconds: 60
max_attempts: 2
- name: 💨 ESLint
run: yarn lint:ci
typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
- name: 📦 Install Dependencies
# Download packages from the registry instead of git-lfs to save git-lfs bandwidth
run: yarn cache clean && yarn install
- name: 📈 Run GraphQL Codegen
uses: nick-fields/retry@v3
with:
command: yarn gql
timeout_minutes: 1
retry_wait_seconds: 60
max_attempts: 2
- name: ✅ TypeScript lint
run: yarn lint:ts
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
- name: 📦 Install Dependencies
# Download packages from the registry instead of git-lfs to save git-lfs bandwidth
run: yarn cache clean && yarn install
- name: 💅 Prettier Check
run: yarn prettier:check
yarn-check-cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
- name: 🔍 Check Yarn Cache
run: yarn install --immutable --immutable-cache --check-cache
crowdin-upload:
runs-on: ubuntu-latest
needs: [test, eslint, typescript, prettier]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
- name: 📦 Install Dependencies
# Download packages from the registry instead of git-lfs to save git-lfs bandwidth
run: yarn cache clean && yarn install
- name: 🌐 Extract Translations
run: yarn extract
- name: 🔤🔼 CrowdIn Translations Upload
uses: crowdin/github-action@v2
with:
upload_sources: true
upload_translations: false
download_sources: false
download_translations: false
env:
CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
bundle-analyzer:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
- name: 📦 Install Dependencies
# Download packages from the registry instead of git-lfs to save git-lfs bandwidth
run: yarn cache clean && yarn install
- name: 📈 Run GraphQL Codegen
uses: nick-fields/retry@v3
with:
command: yarn gql
timeout_minutes: 1
retry_wait_seconds: 60
max_attempts: 2
- name: Build Next.js app
run: yarn build
env:
secrets: '{"JWT_SECRET":"JWT_SECRET","OKTA_CLIENT_SECRET":"OKTA_CLIENT_SECRET"}'
- name: Analyze bundle sizes
uses: transferwise/actions-next-bundle-analyzer@v2
with:
create-issue: false
env:
# This secret is automatically injected by GitHub
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
staging-api-block:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Staging API')
steps:
- run: |
echo "PR cannot be merged until Staging API label is removed"
exit 1