Skip to content

Commit 17e2a2a

Browse files
committed
ci(.github): port build-test-lint to GHA
1 parent ee28e2a commit 17e2a2a

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/pr.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
env:
9+
NX_PARALLEL: 8 # ubuntu-latest = 8-core CPU / 32 GB of RAM
10+
NX_VERBOSE_LOGGING: true
11+
12+
jobs:
13+
main:
14+
runs-on: macos-14-xlarge
15+
permissions:
16+
contents: 'read'
17+
actions: 'read'
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Derive appropriate SHAs for base and head for `nx affected` commands
25+
uses: nrwl/nx-set-shas@v4
26+
27+
- uses: actions/setup-node@v4
28+
with:
29+
cache: 'yarn'
30+
node-version: '20'
31+
32+
- run: yarn install --frozen-lockfile
33+
34+
- name: Workspace lint
35+
run: |
36+
yarn nx run workspace-plugin:check-graph
37+
yarn nx g @fluentui/workspace-plugin:tsconfig-base-all --verify
38+
yarn nx g @fluentui/workspace-plugin:normalize-package-dependencies --verify
39+
40+
- name: Type-check just.config.ts files
41+
run: |
42+
# following packages need to be build in advance:
43+
# @fluentui/api-docs is used within apps/public-docsite-resources/just.config.ts,
44+
# @fluentui/digest is used within packages/fluentui/perf-test-northstar/just.config.ts, thus it needs to be build in advance
45+
#
46+
# NOTE: we are running this via nx in order to get cache hits later on
47+
yarn nx run-many -t build -p api-docs digest
48+
yarn tsc -p ./tsconfig.just-scripts-configs.json
49+
50+
- name: 'check packages: installed dependencies versions'
51+
run: |
52+
yarn check:installed-dependencies-versions
53+
54+
- name: check formatting
55+
run: |
56+
yarn nx format:check --base origin/master
57+
58+
- name: build, test, lint, test-ssr (affected)
59+
run: |
60+
yarn nx affected -t build test lint type-check test-ssr test-integration verify-packaging --nxBail
61+
62+
- name: 'Check for unstaged changes'
63+
run: |
64+
git status --porcelain
65+
git diff-index --quiet HEAD -- || exit 1

0 commit comments

Comments
 (0)