-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcontinuous-deployment-workflow.yml
More file actions
185 lines (164 loc) · 6.79 KB
/
Copy pathcontinuous-deployment-workflow.yml
File metadata and controls
185 lines (164 loc) · 6.79 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: cd
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- run: git config --global --add safe.directory /__w/re-frame-debux/re-frame-debux
- name: Setup java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: '24'
- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@02f5a82b79a547523e664fe8a7a32ea14884d7b2 # 13.6.0
with:
cli: 'latest'
bb: 'latest'
- name: Maven cache
id: maven-cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/deps.edn', '**/project.clj', '.github/workflows/**') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run Clojure tests
run: bb test
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '20'
- name: npm cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install npm deps
run: npm ci
- name: shadow-cljs compiler cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: .shadow-cljs
key: ${{ runner.os }}-shadow-cljs-${{ github.sha }}
restore-keys: |
${{ runner.os }}-shadow-cljs-
- uses: browser-actions/setup-chrome@3ba2f2bc81ddf8088ecbacdea69d476631049f8b # v2.1.1
id: setup-chrome
with:
chrome-version: stable
- name: Run ClojureScript browser tests
# day8.chrome-shadow-test-runner closes Chrome at a fixed
# 60s --virtual-time-budget. On cold-cache CI runs the page
# occasionally serializes before tests register, surfacing as
# "Failed to serialize document: Uncaught" + "No test results
# found". Retry up to 3 times before failing the job.
run: |
for attempt in 1 2 3; do
if bb test-browser; then
exit 0
fi
echo "::warning::bb test-browser flaked on attempt $attempt"
sleep 5
done
exit 1
env:
CHROME_BIN: ${{ steps.setup-chrome.outputs.chrome-path }}
- name: Slack notification
uses: slackapi/slack-github-action@03ea5433c137af7c0495bc0cad1af10403fc800c # v3.0.2
if: failure() || cancelled()
with:
webhook: ${{ secrets.SLACK_WEBHOOK }}
webhook-type: incoming-webhook
payload: |
{
"text": "*re-frame-debux Tests*: ${{ job.status }}\nCommit: <https://github.com/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
}
release:
name: Release
needs: test
runs-on: ubuntu-latest
container:
# Source: https://github.com/day8/dockerfiles-for-dev-ci-images
image: ghcr.io/day8/chrome-56:5.0.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
# All Git history is required for day8.dev's git-app-version!
# to determine the version string.
fetch-depth: 0
- run: git config --global --add safe.directory /__w/re-frame-debux/re-frame-debux
- name: Maven cache
id: maven-cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/deps.edn', '**/project.clj', '.github/workflows/**') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: '24'
- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@02f5a82b79a547523e664fe8a7a32ea14884d7b2 # 13.6.0
with:
cli: 'latest'
bb: 'latest'
# re-frame-debux ships TWO coords: day8.re-frame/tracing (root)
# and day8.re-frame/tracing-stubs (./tracing-stubs/). Each has its
# own Clojars deployment token. Both must release for a tag to be
# complete; the order matters only for downstream-consumer
# discoverability — we ship tracing first, then stubs.
- name: Release day8.re-frame/tracing
run: bb clojars
env:
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN_FOR_TRACING }}
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_TOKEN_FOR_TRACING }}
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release day8.re-frame/tracing-stubs
run: bb clojars-stubs
env:
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN_FOR_TRACING_STUBS }}
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_TOKEN_FOR_TRACING_STUBS }}
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# This creates a 'GitHub Release' from the tag and links to the
# CHANGELOG.md at that point in the Git history. We do not use
# draft or prerelease features as we always want the latest
# release to show in the right hand column of the project page
# regardless of whether it is a stable release.
- name: Create GitHub Release
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ github.ref_name }}
body: |
[Changelog](https://github.com/day8/re-frame-debux/blob/${{ github.ref_name }}/CHANGELOG.md)
draft: false
prerelease: false
- name: Slack notification
uses: slackapi/slack-github-action@03ea5433c137af7c0495bc0cad1af10403fc800c # v3.0.2
if: always()
with:
webhook: ${{ secrets.SLACK_WEBHOOK }}
webhook-type: incoming-webhook
payload: |
{
"text": "*re-frame-debux Deployment*: ${{ job.status }}\nCommit: <https://github.com/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
}