-
Notifications
You must be signed in to change notification settings - Fork 10
203 lines (190 loc) · 6.26 KB
/
main.yml
File metadata and controls
203 lines (190 loc) · 6.26 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
---
name: main
on:
pull_request: {}
push:
branches:
- main
permissions:
contents: read # minimal required permissions to clone repo
jobs:
# We use "o" as the name to keep it short since the flavor repeats
# it, and the current actions interface doesn't show very many
# characters in the test names.
o:
runs-on: ${{ matrix.os }}
name: ${{ matrix.flavor }} - Ruby ${{ matrix.ruby }}
strategy:
fail-fast: false
matrix:
# Change the pb_test_gh_job_id definition below after any
# additions/removals of matrix axes. The flavor "/" is
# converted to "_" in the pdb-job-id below.
flavor:
# terminus rspec tests
- rspec/pup-main
# agent, server, db integration tests
- int/openjdk17/pup-main/srv-main/pg-16/rich
- int/openjdk21/pup-main/srv-main/pg-17/rich
- int/openjdk21/pup-main/srv-main/pg-18/rich
os: [ubuntu-24.04]
ruby: ['3.2', '3.3', '3.4']
# Defaults for special-case influencing vars
lein-profile: ['']
drop-joins: ['']
# Special cases
include:
# lint
- flavor: lint/openjdk17
os: ubuntu-24.04
ruby: '3.4'
# unit
# jdk 21
- flavor: core+ext/openjdk21/pg-18
os: ubuntu-24.04
ruby: '3.4'
- flavor: core+ext/openjdk21/pg-17
os: ubuntu-24.04
ruby: '3.4'
- flavor: core+ext/openjdk21/pg-16
os: ubuntu-24.04
ruby: '3.4'
# jdk 17
- flavor: core+ext/openjdk17/pg-18
os: ubuntu-24.04
ruby: '3.4'
- flavor: core+ext/openjdk17/pg-17
os: ubuntu-24.04
ruby: '3.4'
- flavor: core+ext/openjdk17/pg-16
os: ubuntu-24.04
ruby: '3.4'
steps:
- name: Compute job outputs
id: computed
run: |
# This id must be unique across all jobs
pdb_test_gh_job_id="${{ matrix.os }}/${{ matrix.flavor }}/${{ matrix.ruby }}"
pdb_test_gh_job_id="${pdb_test_gh_job_id//\//_}"
pdb_test_gh_job_id+="_${{ matrix.lein-profile }}"
pdb_test_gh_job_id+="_${{ matrix.drop-joins }}"
echo "day=$(date +%Y-%m-%d)" >> "$GITHUB_OUTPUT"
echo "pdb-job-id=$pdb_test_gh_job_id" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: ruby/setup-ruby@v1
with:
ruby-version: '${{ matrix.ruby }}'
- name: Output Ruby Environment
run: bundle env
- uses: actions/cache@v5
with:
key: |
${{ matrix.flavor }}
${{ runner.os }}
${{ hashFiles('**/Gemfile') }}
${{ hashFiles('**/project.clj') }}
${{ steps.computed.outputs.day }}
%{{ matrix.ruby }}
path: |
ci/local/jdk
vendor/bundle/ruby
~/.m2/repository
~/Library/Caches/Homebrew
- name: Gather inital host info
run: ext/bin/host-info
- env:
LEIN_PROFILES: ${{ matrix.lein-profile }}
PDB_QUERY_OPTIMIZE_DROP_UNUSED_JOINS: ${{ matrix.drop-joins }}
NO_ACCEPTANCE: true
run: ci/bin/prep-and-run-in github ${{ matrix.flavor }}
- uses: actions/upload-artifact@v7
with:
name: "${{ steps.computed.outputs.pdb-job-id }}.zip"
path: |
pg.log
test.log
build:
name: build openvoxdb
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 java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- 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@v7
with:
name: openvoxdb-${{ 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
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 openvoxdb are available in a zip archive:
${{ steps.upload.outputs.artifact-url }}
termini-rspec:
name: openvoxdb-termini RSpec
runs-on: ubuntu-24.04
steps:
- name: checkout repo
uses: actions/checkout@v6
with:
submodules: recursive
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Run RSpec
run: bundle exec rspec spec -fd
working-directory: puppet
tests:
needs:
- o
- build
- termini-rspec
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) }}