-
-
Notifications
You must be signed in to change notification settings - Fork 1
206 lines (174 loc) · 5.54 KB
/
Copy pathci.yml
File metadata and controls
206 lines (174 loc) · 5.54 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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: Continuous Integration
on:
pull_request:
branches: ['**', '!update/**', '!pr/**']
push:
branches: [main]
tags: [v*]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FORCE_COLOR: '1'
concurrency:
group: ${{ github.workflow }} @ ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest]
scala: [3]
java: [temurin@17]
project: [js, jvm, native]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: coursier/setup-action@main
with:
jvm: temurin@17
apps: scala-cli
- name: Cache Coursier
uses: actions/cache@v4
with:
path: ~/.cache/coursier/v1
key: coursier-${{ runner.os }}-${{ hashFiles('build.mill', '**/package.mill') }}
restore-keys: coursier-${{ runner.os }}-
- name: Setup NodeJS v18 LTS
if: matrix.project == 'js'
uses: actions/setup-node@v3
with:
node-version: 20
cache: npm
- name: formatCheck
if: matrix.project == 'jvm'
run: ./mill mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources
- if: matrix.project == 'js'
run: npm install
- if: matrix.project == 'native'
run: sudo apt-get install -y libatlas-base-dev
- name: scalaJSLink
if: matrix.project == 'js'
run: ./mill vecxt.${{ matrix.project }}.fastLinkJS
- name: nativeLink
if: matrix.project == 'native'
run: ./mill vecxt.${{ matrix.project }}.test.nativeLink
- name: Test
run: ./mill vecxt.${{ matrix.project }}.test
- name: Test
run: ./mill vecxtensions.${{ matrix.project }}.test
- name: Test
run: ./mill vecxt_re.${{ matrix.project }}.test
- name: Laws Test
if: matrix.project == 'jvm'
run: ./mill laws.${{ matrix.project }}.test
- name: Doc Gen
if: matrix.project == 'jvm'
run: ./mill site.siteGen
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: always()
with:
fail_on_failure: false
include_passed: false
detailed_summary: true
annotate_only: true
require_tests: false
report_paths: 'out/**/test-report.xml'
publish:
if: github.repository == 'Quafadas/vecxt' && contains(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: coursier/setup-action@main
with:
jvm: temurin@17
apps: scala-cli
- name: Cache Coursier
uses: actions/cache@v4
with:
path: ~/.cache/coursier/v1
key: coursier-${{ runner.os }}-${{ hashFiles('build.mill', '**/package.mill') }}
restore-keys: coursier-${{ runner.os }}-
- name: Publish to Maven Central
run: ./mill mill.javalib.SonatypeCentralPublishModule/
env:
MILL_PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
MILL_PGP_SECRET_BASE64: ${{ secrets.PGP_SECRET }}
MILL_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
MILL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
site:
needs: build
runs-on: ubuntu-latest
steps:
- uses: coursier/setup-action@main
with:
jvm: temurin@17
apps: scala-cli
- name: Cache Coursier
uses: actions/cache@v4
with:
path: ~/.cache/coursier/v1
key: coursier-${{ runner.os }}-${{ hashFiles('build.mill', '**/package.mill') }}
restore-keys: coursier-${{ runner.os }}-
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
ref: benchmark
- name: Aggregate benchmark results
run: |
chmod +x aggregate.sh
./aggregate.sh
- name: Switch to target branch
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
git fetch origin ${{ github.head_ref }}
git checkout -f ${{ github.head_ref }}
git reset --hard origin/${{ github.head_ref }}
else
git fetch origin main
git checkout -f main
git reset --hard origin/main
fi
ls
- name: Copy benchmark results into docs generation
run: mkdir -p site/docs/_assets/benchmarks && cp benchmark_history.json site/docs/_assets/benchmarks/benchmark_history.json
- name: Generate static site
run: ./mill site.siteGen
- name: Setup Pages
uses: actions/configure-pages@main
- uses: actions/upload-artifact@main
with:
name: page
path: out/site/laika/generateSite.dest
if-no-files-found: error
deploy:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
needs: site
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@main
with:
name: page
path: .
- uses: actions/configure-pages@main
- uses: actions/upload-pages-artifact@main
with:
path: .
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@main