-
Notifications
You must be signed in to change notification settings - Fork 21
173 lines (166 loc) · 5.27 KB
/
pr-testing.yml
File metadata and controls
173 lines (166 loc) · 5.27 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
---
name: PR Testing
on:
pull_request: {}
push:
branches:
- main
permissions:
contents: read
jobs:
clojure-tests:
name: Clojure Tests - Java ${{ matrix.version }} ${{ matrix.filter }} ${{ matrix.javaargs }}
strategy:
fail-fast: false
matrix:
javaargs: ['with-profile fips', '']
filter: [':singlethreaded', ':multithreaded']
version: ['17', '21']
exclude:
- javaargs: 'with-profile fips'
version: '21'
filter: ':multithreaded'
- javaargs: 'with-profile fips'
version: '21'
filter: ':singlethreaded'
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v6
with:
submodules: recursive
- name: setup java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: ${{ matrix.version }}
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@13.5
with:
lein: latest
- name: setup gems
run: ./dev-setup
- name: clojure tests
run: lein -U ${{ matrix.javaargs }} test ${{ matrix.filter }}
timeout-minutes: 120
rspec-tests:
name: Rspec Tests - Java ${{ matrix.java }} Ruby ${{ matrix.ruby }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
java: ['17', '21']
ruby: ['3.1', '3.2', '3.3', '3.4', '4.0']
steps:
- name: checkout repo
uses: actions/checkout@v6
with:
submodules: recursive
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: setup java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@13.5
with:
lein: latest
- name: setup gems
run: ./dev-setup
- name: rspec tests
run: rake spec
build:
name: build openvox-server
runs-on: ubuntu-24.04
permissions:
pull-requests: write
steps:
- name: checkout repo
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0 # So we fetch all history and tags and can build non-tagged versions
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
# uses the Dockerfile to build openvox-server in a container
# the container hardcodes the java version
- name: build it
run: bundle exec rake vox:build
- name: get version
id: version
run: |
DESCRIBE=$(git describe --abbrev=9)
echo "describe=${DESCRIBE//-/.}" >> $GITHUB_OUTPUT
- name: Upload build artifacts
id: upload
uses: actions/upload-artifact@v6
with:
name: openvox-server-${{ steps.version.outputs.describe }}.zip
path: output/
retention-days: 1 # quite low retention, because the artifacts are quite large
overwrite: true # overwrite old artifacts if a PR runs again (artifacts are per PR * per project)
- name: Find existing comment
uses: peter-evans/find-comment@v4
# Check if the event is not triggered by a fork
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#restrictions-on-repository-forks
if: github.event.pull_request.head.repo.full_name == github.repository
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: '<!-- build-artifacts -->'
- name: Add or update comment
uses: peter-evans/create-or-update-comment@v5
if: github.event.pull_request.head.repo.full_name == github.repository
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |-
<!-- build-artifacts -->
The rpm/deb packages and the JAR file for openvox-server are available in a zip archive:
${{ steps.upload.outputs.artifact-url }}
clojure-linting:
name: Clojure Linting
runs-on: ubuntu-latest
steps:
- name: setup java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: checkout repo
uses: actions/checkout@v6
# newer versions cause lint errors
# https://github.com/clj-kondo/clj-kondo/releases
- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@13.5
with:
clj-kondo: 2025.02.20
- name: kondo lint
run: clj-kondo --lint src test
tests:
if: always()
needs:
- clojure-tests
- rspec-tests
- clojure-linting
- build
runs-on: ubuntu-24.04
name: Test suite
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}