-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 1.06 KB
/
c-cpp.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
name: C/C++ CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.sys.os }}
strategy:
matrix:
sys:
- { os: ubuntu-latest, shell: bash }
- { os: macos-latest, shell: bash }
- { os: windows-latest, shell: 'msys2 {0}' }
defaults:
run:
shell: ${{ matrix.sys.shell }}
steps:
- uses: actions/checkout@v4
- if: ${{ runner.os == 'Windows' }}
# Based on https://www.msys2.org/docs/ci/
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: git mingw-w64-ucrt-x86_64-gcc make
- name: make
run: make clean && make -j
- name: make check
run: |
# Test output is too verbose, so just show last N lines.
testout="$(make check -j 2>&1)" &&
(printf '[...beginning of test output omitted...]\n' &&
printf '%s\n' "$testout" | tail -n100) ||
(printf '%s\n' "$testout" | tail -n500; exit 1)