Skip to content

Commit 0def676

Browse files
ci: update github action
1 parent 34a9751 commit 0def676

1 file changed

Lines changed: 20 additions & 23 deletions

File tree

.github/workflows/pr_on_master.yml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
1-
# File for Pull Request on master branch
21
name: PR on master
32

4-
# When a PR is opened to master
53
on:
64
pull_request:
7-
branches:
8-
- master
5+
branches: [master]
96
types: [opened, reopened, synchronize]
107

118
jobs:
129
build:
13-
# Setup OS and Node Version
1410
runs-on: ubuntu-latest
11+
1512
strategy:
1613
matrix:
17-
# Latest nodes only
1814
node-version: [18.x]
19-
# Define Steps
15+
2016
steps:
21-
# Checkout code
22-
- uses: actions/checkout@v4
17+
- name: Checkout code
18+
uses: actions/checkout@v4
2319
with:
24-
ref: ${{ github.event.pull_request.head.ref }}
2520
fetch-depth: 0
2621

2722
- name: Use Node.js ${{ matrix.node-version }}
@@ -30,20 +25,22 @@ jobs:
3025
node-version: ${{ matrix.node-version }}
3126
cache: 'npm'
3227

33-
# Make sure we have all branches
34-
- name: Fetch other branches
35-
run: git fetch --no-tags --prune --depth=5 origin master
36-
37-
- uses: nrwl/nx-set-shas@v4
28+
- name: Set NX SHAs
29+
uses: nrwl/nx-set-shas@v4
3830
with:
3931
main-branch-name: 'master'
4032

41-
- name: Install environment
42-
run: npm ci --include=dev
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Lint affected projects
37+
run: npx nx affected --target=lint --parallel=3
38+
39+
- name: Check formatting
40+
run: npx nx format:check --base=origin/master --verbose
41+
42+
- name: Test affected projects
43+
run: npx nx affected --target=test --parallel=3 --ci --code-coverage --verbose
4344

44-
- run: npx nx lint
45-
- run: npx nx format:write --base="origin/master" --code-coverage --verbose
46-
- run: npx nx format:check --base="origin/master" --code-coverage --verbose
47-
- run: npx nx affected --target=lint --parallel=3
48-
- run: npx nx affected --target=test --parallel=3 --ci --code-coverage --verbose
49-
- run: npx nx affected --target=build --parallel=3
45+
- name: Build affected projects
46+
run: npx nx affected --target=build --parallel=3

0 commit comments

Comments
 (0)