-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (63 loc) · 2.21 KB
/
ci.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
name: CI - Build & Test
on:
push:
branches: [master]
pull_request:
branches: [master, dev]
defaults:
run:
shell: bash
jobs:
ci:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
compiler: [gcc, clang]
exclude:
- os: windows-latest
compiler: clang
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- uses: actions/checkout@v2
# - name: Check (with ${{matrix.compiler}}, for ${{matrix.os}})
# run: |
# printf "OS: $OS\n"
# printf "RUNNER_OS: $RUNNER_OS\n"
# printf "uname -s: $(uname -s)\n"
# env
# make clean-log
# make test-env-predef
# for i in `find log -name "predef_*.c"` ; do cat $i ; done
- name: Setup
if: ${{ (matrix.os != 'windows-latest') || (matrix.compiler != 'gcc') }}
run: |
echo "CC=${{matrix.compiler}}" >> $GITHUB_ENV
- name: Setup (Windows, mingw)
if: ${{ (matrix.os == 'windows-latest') && (matrix.compiler == 'gcc') }}
run: |
echo "CC=x86_64-w64-mingw32-gcc" >> $GITHUB_ENV
# echo "PATH=$PATH:C:\msys64\mingw64\bin" >> $GITHUB_ENV
- name: Prerequisite tools install
run: |
make prereq-build
make prereq-tests
make prereq-dist
- name: Build library (with ${{matrix.compiler}}, for ${{matrix.os}})
run: make BUILDMODE=release build CC=$CC
- name: Build test suite (with ${{matrix.compiler}}, for ${{matrix.os}})
run: make BUILDMODE=release build-tests CC=$CC
- name: Run test suite (with ${{matrix.compiler}}, for ${{matrix.os}})
run: make BUILDMODE=release test ARGS="-a"
- name: Create distributable package (for ${{matrix.os}})
run: make BUILDMODE=release dist
- name: Upload build binary artifacts
uses: actions/upload-artifact@v4
with:
name: libccc-build_${{matrix.os}}_${{matrix.compiler}}
path: ./dist/*.zip
# - name: Release (with ${{matrix.compiler}}, for ${{matrix.os}})
# run: make clean ; make build-release CC=${{matrix.compiler}}
# TODO: automate release tag for github ?