-
Notifications
You must be signed in to change notification settings - Fork 3
103 lines (92 loc) · 3.47 KB
/
test-build.yml
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
name: Test Build
on:
workflow_call:
inputs:
runner:
type: string
default: '["gcc", "lite", "2204"]'
runner-archs:
type: string
default: '["amd64", "aarch64", "armv7l"]'
options:
type: string
default: 'auto_features=enabled'
valgrind:
type: boolean
default: true
plugin:
type: string
default: ''
secrets:
GIT_CLONE_PAT:
required: false
AWS_ACCESS_KEY:
required: false
AWS_SECRET_ACCESS_KEY:
required: false
jobs:
test_build:
name: Test Build
#runs-on: ${{ matrix.group }} #] #, "${{ fromJSON(inputs.runner) }}"]
runs-on: ${{ format('{0}-{1}', join(fromJSON(inputs.runner), '-'), matrix.arch) }}
strategy:
matrix:
#archconfig: ["${{ fromJSON(inputs.runner-archs) }}"]
#group: ${{ fromJson(needs.generate-matrix.outputs.runner_group) }}
#group: ${{ fromJson(inputs.runner-archs) | map(if . == 'x86_64' then 'gcc-lite-2204-amd64' else 'gcc-lite-2204-' + . end) }}
#group: ${{ fromJson(github.event.inputs.runner-archs) | map( 'gcc-lite-2204-' + (replace(., 'x86_64', 'amd64')) ) | join(',') }}
#arch: [ {ci: x86_64, runner: amd64}, {ci: aarch64, runner: arm64}, {ci: armv7l, runner: armv7l} ]
arch: ["${{ fromJSON(inputs.runner-archs) }}" ]
build_type: [debug, release]
fail-fast: false
env:
ARCH: ${{ fromJson('{ "amd64": "x86_64", "aarch64": "aarch64", "armv7l": "armv7l" }')[amd64] }}
CC: gcc-12
CXX: g++-12
steps:
- name: Checkout .github directory
uses: actions/checkout@v4
with:
sparse-checkout: .github
repository: ${{ (inputs.plugin != '' && 'nubificus/vaccel') || '' }}
ref: ${{ (inputs.plugin != '' && 'main') || '' }}
- name: Extract arch
run: |
arch_env=$(echo "${{ matrix.group }}" | sed 's/.*-//')
echo "ARCH=$arch_env" >> "$GITHUB_ENV"
- name: Initialize workspace
id: initialize_workspace
uses: ./.github/actions/initialize-workspace
with:
remote-actions-repo: ${{ (inputs.plugin != '' && 'nubificus/vaccel') || '' }}
token: ${{ secrets.GIT_CLONE_PAT || github.token }}
- name: Download artifacts from s3
if: ${{ inputs.plugin != '' }}
uses: ./.github/actions/download-from-s3
with:
branch: ${{ steps.initialize_workspace.outputs.remote-branch }}
build-type: ${{matrix.build_type}}
arch: ${{env.ARCH}}
access-key: ${{ secrets.AWS_ACCESS_KEY }}
secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
output-dir: ./artifacts/downloads/${{env.ARCH}}/${{matrix.build_type}}
install: 'true'
- name: Build project
uses: ./.github/actions/build
with:
prefix: ${{github.workspace}}/artifacts/${{env.ARCH}}/${{matrix.build_type}}/opt
build-dir: build_${{matrix.build_type}}
build-type: ${{matrix.build_type}}
options: ${{ inputs.options }}
- name: Run tests
uses: ./.github/actions/run-tests
with:
valgrind: ${{ inputs.valgrind }}
build-dir: build_${{matrix.build_type}}
- name: Clean-up
if: ${{ always() }}
run: |
sudo rm -rf artifacts build_${{ matrix.build_type }}
[ -n "$(dpkg -l vaccel 2> /dev/null)" ] && \
sudo apt-get purge -y vaccel || echo
shell: bash