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: split lint/test/build/typecheck in to separate jobs #4545

Merged
merged 1 commit into from
Feb 3, 2025
Merged
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
92 changes: 83 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ concurrency:

jobs:
build:
name: Check, build and test
name: Build and test
runs-on: ubuntu-latest
outputs:
gitsha: ${{ steps.setDockerSHAs.outputs.gitsha }}
Expand Down Expand Up @@ -55,15 +55,10 @@ jobs:
- name: Install NPM dependencies
run: npm ci

- name: Check formatting
env:
UESIO_DEV: "true"
run: npx nx format:check --verbose

- name: Lint, test, build
- name: Build and test
env:
UESIO_DEV: "true"
run: npx nx affected -t lint test build typecheck --configuration=ci --parallel=5
run: npx nx affected -t build test --configuration=ci --parallel=5

- name: Prep for docker image
id: setDockerSHAs
Expand Down Expand Up @@ -139,11 +134,90 @@ jobs:
# then run all Integration and E2E tests against the app
npm run tests-ci

check:
name: Check format and lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0

- name: Derive appropriate SHAs for base and head for `nx affected` commands
id: setNxSHAs
uses: nrwl/nx-set-shas@v4

- name: Ensure tracking against main
run: git branch --track main origin/main
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"

- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.work
cache-dependency-path: |
apps/*/go.sum
go.work.sum

- name: Install NPM dependencies
run: npm ci

- name: Check formatting
env:
UESIO_DEV: "true"
run: npx nx format:check --verbose

- name: Lint
env:
UESIO_DEV: "true"
run: npx nx affected -t lint --configuration=ci --parallel=5

typecheck:
name: Check types
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0

- name: Derive appropriate SHAs for base and head for `nx affected` commands
id: setNxSHAs
uses: nrwl/nx-set-shas@v4

- name: Ensure tracking against main
run: git branch --track main origin/main
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"

- name: Install NPM dependencies
run: npm ci

- name: Typecheck
env:
UESIO_DEV: "true"
run: npx nx affected -t typecheck --configuration=ci --parallel=5

update-dev-branch:
name: Update Dev environment to latest image
if: github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
needs: build
needs: [build, check, typecheck]
timeout-minutes: 3
permissions:
id-token: write # This is required for requesting a OIDC JWT for AWS
Expand Down
Loading