-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (79 loc) · 2.32 KB
/
main.yaml
File metadata and controls
93 lines (79 loc) · 2.32 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
on:
push:
branches:
- main
- 'release/**'
pull_request:
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-latest
outputs:
directories: ${{ steps.list-dirs.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: list-dirs
run: |
# Finds example subdirs and creates a JSON array ["dir1", "dir2"]
DIRS=$(find examples -maxdepth 1 -mindepth 1 -type d -printf '%P\n' | jq -R -s -c 'split("\n")[:-1]')
echo "matrix=$DIRS" >> $GITHUB_OUTPUT
build:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
gnat_version: ["^14", "^15"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: alire-project/setup-alire@v4
with:
version: 2.1.0
toolchain: gnat_native${{ matrix.gnat_version }} gprbuild --disable-assistant
- name: Build (validation)
run: |
alr build --validation
- name: Build examples
shell: bash
run: |
cd examples
./build-all.sh --profile=validation
- name: Run unit tests
shell: bash
run: |
cd tests/unit_tests
alr build \
--profiles=unit_tests=validation,libsap=validation \
-- \
-XUNIT_TEST_REPORT_FORMAT=JUnit
mkdir reports
bin/unit_tests > reports/unit_tests.xml
cat reports/unit_tests.xml
- name: Test Report
uses: dorny/test-reporter@v2
if: ${{ !cancelled() }} # run this step even if previous step failed
with:
name: Unit Tests
path: tests/unit_tests/reports/*.xml
reporter: java-junit
prove:
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
subdir: ${{ fromJson(needs.setup.outputs.directories) }}
steps:
- uses: actions/checkout@v4
- uses: alire-project/setup-alire@v4
with:
version: 2.1.0
- name: Prove example ${{ matrix.subdir }}
shell: bash
run: |
cd examples/${{ matrix.subdir }}
alr build --stop-after=generation
alr exec -- gnatprove \
-P ${{ matrix.subdir}}.gpr \
--level=1 \
-j0 \
--warnings=error \
--checks-as-errors=on