File tree 2 files changed +61
-11
lines changed
actions/prepare-playground 2 files changed +61
-11
lines changed Original file line number Diff line number Diff line change
1
+ name : Clone the repository, install dependencies, and configures nx variables
2
+
3
+ runs :
4
+ using : ' composite'
5
+ steps :
6
+ - name : Fetch trunk
7
+ shell : bash
8
+ run : git fetch origin trunk --depth=1
9
+ - uses : actions/setup-node@v3
10
+ - name : Cache node modules
11
+ id : cache-nodemodules
12
+ uses : actions/cache@v2
13
+ env :
14
+ cache-name : cache-node-modules
15
+ with :
16
+ # caching node_modules
17
+ path : node_modules
18
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
19
+ restore-keys : |
20
+ ${{ runner.os }}-build-${{ env.cache-name }}-
21
+ ${{ runner.os }}-build-
22
+ ${{ runner.os }}-
23
+ - name : Install Dependencies
24
+ shell : bash
25
+ if : steps.cache-nodemodules.outputs.cache-hit != 'true'
26
+ run : npm ci
27
+ - name : Set NX_BASE
28
+ shell : bash
29
+ run : echo "NX_BASE=$(git rev-parse origin/trunk)" >> $GITHUB_ENV
30
+ - name : Set NX_HEAD
31
+ shell : bash
32
+ run : echo "NX_HEAD=$(git rev-parse HEAD)" >> $GITHUB_ENV
Original file line number Diff line number Diff line change 6
6
pull_request :
7
7
8
8
jobs :
9
- main :
9
+ warmup-cache :
10
10
runs-on : ubuntu-latest
11
11
steps :
12
- - uses : actions/checkout@v2
13
- with :
14
- fetch-depth : 0
15
- - uses : actions/setup-node@v3
16
- - uses : nrwl/nx-set-shas@v3
17
- with :
18
- main-branch-name : ' trunk '
19
- - run : npm ci
12
+ - uses : actions/checkout@v3
13
+ - uses : ./.github/actions/prepare-playground
14
+ format :
15
+ runs-on : ubuntu-latest
16
+ needs : [warmup-cache]
17
+ steps :
18
+ - uses : actions/checkout@v3
19
+ - uses : ./.github/actions/prepare-playground
20
20
- run : npx nx format:check || npx prettier --check .
21
+ - run : npx nx affected --target=lint
22
+ typecheck :
23
+ runs-on : ubuntu-latest
24
+ needs : [warmup-cache]
25
+ steps :
26
+ - uses : actions/checkout@v3
27
+ - uses : ./.github/actions/prepare-playground
21
28
- run : npx nx affected --target=typecheck
22
- - run : npx nx affected --target=lint --parallel=3
23
- - run : npx nx affected --target=test --parallel=3 --configuration=ci
29
+ test :
30
+ runs-on : ubuntu-latest
31
+ needs : [warmup-cache]
32
+ steps :
33
+ - uses : actions/checkout@v3
34
+ - uses : ./.github/actions/prepare-playground
35
+ - run : npx nx affected --target=test --configuration=ci
36
+ build :
37
+ runs-on : ubuntu-latest
38
+ needs : [warmup-cache]
39
+ steps :
40
+ - uses : actions/checkout@v3
41
+ - uses : ./.github/actions/prepare-playground
24
42
- run : npx nx affected --target=build --parallel=3
You can’t perform that action at this time.
0 commit comments