-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (61 loc) · 2.11 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
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: 5
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
cc: [clang, gcc]
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- uses: actions/checkout@v4
# - name: Check (with ${{matrix.cc}}, 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
run: |
echo "CC=${{matrix.cc}}" >> $GITHUB_ENV
echo "LD=${{matrix.cc}}" >> $GITHUB_ENV
- name: Setup (Windows, mingw 64-bit)
if: ${{ (matrix.os == 'windows-latest') && (matrix.cc == 'gcc') }}
run: |
echo "CC=x86_64-w64-mingw32-gcc" >> $GITHUB_ENV
# echo "CC=i686-w64-mingw32-gcc" >> $GITHUB_ENV
# echo "PATH=$PATH:C:\msys64\mingw64\bin" >> $GITHUB_ENV
- name: Install/check prerequisite tools
run: |
make prereq-build
make prereq-tests
make prereq-dist
- name: Build library (with ${{matrix.cc}}, for ${{matrix.os}})
run: make BUILDMODE=release build CC=$CC
- name: Build test suite (with ${{matrix.cc}}, for ${{matrix.os}})
run: make BUILDMODE=release build-tests CC=$CC
- name: Run test suite (with ${{matrix.cc}}, 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.cc}}
path: ./dist/*.zip
# - name: Release (with ${{matrix.cc}}, for ${{matrix.os}})
# run: make clean ; make build-release CC=${{matrix.cc}}
# TODO: automate release tag for github ?