-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (157 loc) · 4.52 KB
/
Copy pathtest-pr.yml
File metadata and controls
169 lines (157 loc) · 4.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Test and publish
on:
push:
branches:
- main
- develop
pull_request:
concurrency:
cancel-in-progress: true
group: "test-and-publish-${{ github.ref }}"
jobs:
action-lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- name: Download actionlint
id: get_actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
shell: bash
- name: actionlint version
run: ${{ steps.get_actionlint.outputs.executable }} -version
shell: bash
- name: Check workflow files
# TODO: include composites (https://github.com/rhysd/actionlint/issues/46)
run: ${{ steps.get_actionlint.outputs.executable }} -color -verbose
shell: bash
audit:
timeout-minutes: 10
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.yarn
.yarn
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: sdlc:audit
run: |
yarn --frozen-lockfile
npx audit-ci --high
build:
runs-on: ubuntu-latest
needs:
- action-lint
- audit
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
- name: Build on Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.5.1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v3
with:
path: |
~/.yarn
.yarn
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- run: yarn --frozen-lockfile
- run: |
yarn build
name: Build
# Upload build artifacts
- uses: actions/upload-artifact@v3
with:
name: Linux-AppImage-Build
path: dist/DistributionZ-0.0.0.AppImage
- uses: actions/upload-artifact@v3
with:
name: Linux-Snap-Build
path: dist/DistributionZ_0.0.0_amd64.snap
# test:
# runs-on: ubuntu-latest
# needs:
# - build
# strategy:
# matrix:
# node-version: [12.x, 14.x, 16.x, 17.x ]
# steps:
# - uses: actions/checkout@v3
# - name: Install Node ${{ matrix.node-version }}
# uses: actions/setup-node@v3.5.1
# with:
# node-version: ${{ matrix.node-version }}
# - uses: actions/cache@v3
# with:
# path: |
# ~/.yarn
# .yarn
# node_modules
# key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
# - run: npm ci --ignore-scripts
# - run: npm run build --if-present
# name: Build
# - run: npm test -- --coverage
# env:
# CI: true
# - uses: codecov/codecov-action@v3
semantic-release:
runs-on: ubuntu-latest
timeout-minutes: 10
needs:
- build
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-node@v3.5.1
with:
node-version: 16.x
- uses: actions/cache@v3
with:
path: |
~/.yarn
.yarn
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- shell: bash
run: |
sudo npm install -g \
semantic-release@latest \
@semantic-release/git@latest \
@semantic-release/release-notes-generator@latest \
@semantic-release/github@latest
- shell: bash
run: |
semantic-release \
--branches main \
--plugins "@semantic-release/commit-analyzer,@semantic-release/release-notes-generator,@semantic-release/git,@semantic-release/github" \
--tag-format "\${version}" \
--debug true
env:
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN || github.token }}
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN || github.token }}
auto-merge:
needs:
- semantic-release
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: fastify/github-action-merge-dependabot@v3.5.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}