Skip to content

Commit

Permalink
chore: split lint/test/build/typecheck in to separate jobs (#4545)
Browse files Browse the repository at this point in the history
  • Loading branch information
techfg authored Feb 3, 2025
1 parent c022628 commit c341bcd
Showing 1 changed file with 83 additions and 9 deletions.
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

0 comments on commit c341bcd

Please sign in to comment.