@@ -2,98 +2,52 @@ name: QA
2
2
on : [pull_request]
3
3
jobs :
4
4
lint :
5
- runs-on : ubuntu-latest
5
+ runs-on : ubuntu-22.04
6
6
steps :
7
- - uses : actions/checkout@v3
8
- - uses : pnpm/action-setup@v2.2.4
7
+ - uses : actions/checkout@v4
8
+ - name : Setup PNPM
9
+ uses : pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
9
10
with :
10
- version : 8.2.0
11
- - uses : actions/setup-node@v3
12
- with :
13
- node-version : 18
14
- cache : pnpm
15
- - name : Install dependencies
16
- run : pnpm install
17
- - name : Check linters
11
+ run_install : |
12
+ - args: [--frozen-lockfile]
13
+ - name : Check linter
18
14
run : pnpm lint
15
+ - name : Check types
16
+ run : pnpm check-types
19
17
20
18
test :
21
- runs-on : ubuntu-latest
19
+ runs-on : ubuntu-22.04
22
20
steps :
23
- - uses : actions/checkout@v3
24
- - uses : pnpm/action-setup@v2.2.4
25
- with :
26
- version : 8.2.0
27
- - uses : actions/setup-node@v3
21
+ - uses : actions/checkout@v4
22
+ - name : Setup PNPM
23
+ uses : pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
28
24
with :
29
- node-version : 18
30
- cache : " pnpm"
31
- - name : Install dependencies
32
- run : pnpm install
33
- - name : Test
25
+ run_install : |
26
+ - args: [--frozen-lockfile]
27
+ - name : Run tests
34
28
run : pnpm test:ci
35
29
- name : Generate coverage report
36
- uses : irongut/CodeCoverageSummary@v1.3.0
30
+ uses : irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0
37
31
if : ${{ github.actor != 'dependabot[bot]' }}
38
32
with :
39
33
filename : coverage/cobertura-coverage.xml
40
34
format : markdown
41
35
output : file
42
-
43
36
- name : Add Coverage PR Comment
44
- uses : marocchino/sticky-pull-request-comment@v2
37
+ uses : marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0
45
38
if : ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }}
46
39
with :
47
40
recreate : true
48
41
path : code-coverage-results.md
49
42
50
43
build :
51
- runs-on : ubuntu-latest
44
+ runs-on : ubuntu-22.04
52
45
steps :
53
- - uses : actions/checkout@v3
54
- - uses : pnpm/action-setup@v2.2.4
55
- - uses : actions/setup-node@v3
46
+ - uses : actions/checkout@v4
47
+ - name : Setup PNPM
48
+ uses : pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
56
49
with :
57
- node-version : 18
58
- cache : pnpm
59
- - uses : actions/cache@v3
60
- with :
61
- path : |
62
- ${{ github.workspace }}/.next/cache
63
- key : ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
64
- # If source files changed but packages didn't, rebuild from a prior cache.
65
- restore-keys : |
66
- ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.json') }}-
67
- - name : Install dependencies
68
- run : pnpm install
69
- - name : Build project
50
+ run_install : |
51
+ - args: [--frozen-lockfile]
52
+ - name : Build package
70
53
run : pnpm build
71
- - name : Creating .npmrc
72
- if : ${{ github.actor != 'dependabot[bot]' }}
73
- run : |
74
- cat << EOF > "$HOME/.npmrc"
75
- //registry.npmjs.org/:_authToken=$NPM_TOKEN
76
- EOF
77
- env :
78
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
79
- - name : Release on @dev tag in npm
80
- if : ${{ github.actor != 'dependabot[bot]' }}
81
- run : npx changeset version --snapshot pr && pnpm publish --tag dev --no-git-checks
82
- # Store package.json version in env
83
- - run : echo "PACKAGE_JSON=$(jq -c . < package.json)" >> $GITHUB_ENV
84
- if : ${{ github.actor != 'dependabot[bot]' }}
85
- - run : echo '${{ fromJson(env.PACKAGE_JSON).version }}'
86
- if : ${{ github.actor != 'dependabot[bot]' }}
87
- # Post a comment with released snapshot
88
- - name : Create with released tag
89
- if : ${{ github.actor != 'dependabot[bot]' }}
90
- uses : peter-evans/create-or-update-comment@v2
91
- with :
92
- issue-number : ${{ github.event.pull_request.number }}
93
- body : |
94
- Released snapshot build with `@dev` tag in npm with version: `${{ fromJson(env.PACKAGE_JSON).version }}`
95
-
96
- Install it with
97
- ```bash
98
- pnpm add @saleor/app-sdk@${{ fromJson(env.PACKAGE_JSON).version }}
99
- ```
0 commit comments