|
| 1 | +name: Test |
1 | 2 | on:
|
2 | 3 | push:
|
3 | 4 | pull_request:
|
4 | 5 |
|
5 | 6 | jobs:
|
6 |
| - linux: |
7 |
| - name: ci |
8 |
| - runs-on: ubuntu-latest |
9 |
| - |
10 |
| - container: |
11 |
| - image: ubuntu:22.04 |
12 |
| - |
| 7 | + non-linux-tests: |
| 8 | + name: ${{ matrix.os.name }} tests ( ${{ matrix.config }} ) |
| 9 | + runs-on: ${{ matrix.os.runner }} |
13 | 10 | strategy:
|
14 | 11 | matrix:
|
15 |
| - include: |
16 |
| - - CC: gcc |
17 |
| - CXX: g++ |
18 |
| - - CC: clang |
19 |
| - CXX: clang++ |
| 12 | + os: [{ name: "MacOS", runner: "macos-latest"}, { name: "Windows", runner: "windows-latest"}] |
| 13 | + config: ["Debug", "Release"] |
| 14 | + steps: |
20 | 15 |
|
21 |
| - # don't run pull requests from local branches twice |
22 |
| - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository |
| 16 | + - uses: actions/checkout@v3 |
| 17 | + with: |
| 18 | + submodules: 'true' |
| 19 | + - name: Build source |
| 20 | + uses: ./.github/actions/build-cppdap |
| 21 | + with: |
| 22 | + config: ${{ matrix.config }} |
| 23 | + tests: true |
| 24 | + install: true |
23 | 25 |
|
| 26 | + - name: Run tests |
| 27 | + run: | |
| 28 | + cd build |
| 29 | + ctest --output-on-failure -C ${{ matrix.config }} |
| 30 | +
|
| 31 | + - uses: actions/upload-artifact@v3 |
| 32 | + with: |
| 33 | + # if flags are not empty, append them to the name |
| 34 | + name: cppdap-${{ matrix.os.name }}-${{ matrix.config }} |
| 35 | + path: out/usr/local/ |
| 36 | + |
| 37 | + linux-tests: |
| 38 | + name: Linux tests ( ${{ matrix.config }} ${{ matrix.compiler.CC }} ${{ matrix.sanitizer }} ) |
| 39 | + runs-on: ${{ matrix.os }} |
| 40 | + strategy: |
| 41 | + fail-fast: false |
| 42 | + matrix: |
| 43 | + os: ["ubuntu-22.04"] #[ubuntu-22.04, ubuntu-24.04] |
| 44 | + config: ["Debug", "Release"] |
| 45 | + compiler: [ {CXX: g++, CC: gcc}, {CXX: clang++, CC: clang} ] |
| 46 | + sanitizer: ["", "asan", "tsan"] |
| 47 | + exclude: |
| 48 | + - config: "Release" |
| 49 | + sanitizer: "asan" |
| 50 | + - config: "Release" |
| 51 | + sanitizer: "tsan" |
24 | 52 | env:
|
25 | 53 | DEBIAN_FRONTEND: noninteractive
|
26 | 54 |
|
27 | 55 | steps:
|
28 | 56 | - name: Install packages
|
29 | 57 | run: |
|
30 |
| - apt-get -q -y update |
31 |
| - apt-get -q -y install build-essential cmake git clang |
| 58 | + sudo apt-get -q -y update |
| 59 | + sudo apt-get -q -y install build-essential cmake git clang |
32 | 60 |
|
33 | 61 | - uses: actions/checkout@v3
|
34 | 62 | with:
|
35 | 63 | submodules: 'true'
|
36 | 64 |
|
37 | 65 | - name: Build source
|
| 66 | + uses: ./.github/actions/build-cppdap |
| 67 | + with: |
| 68 | + msan: ${{ contains(matrix.sanitizer, 'msan') }} |
| 69 | + tsan: ${{ contains(matrix.sanitizer, 'tsan') }} |
| 70 | + asan: ${{ contains(matrix.sanitizer, 'asan') }} |
| 71 | + config: ${{ matrix.config }} |
| 72 | + tests: true |
| 73 | + fuzzer: false |
| 74 | + CC: ${{ matrix.compiler.CC }} |
| 75 | + CXX: ${{ matrix.compiler.CXX }} |
| 76 | + install: true |
| 77 | + |
| 78 | + - name: Run tests |
| 79 | + shell: bash |
38 | 80 | run: |
|
39 |
| - mkdir -p build |
40 | 81 | cd build
|
41 |
| - CC=${{ matrix.CC }} CXX=${{ matrix.CXX }} cmake .. |
42 |
| - cmake --build . |
43 |
| - DESTDIR=../out cmake --install . |
| 82 | + ./cppdap-unittests |
44 | 83 |
|
45 | 84 | - uses: actions/upload-artifact@v4
|
46 | 85 | with:
|
47 |
| - name: cppdap-${{ matrix.CC }} |
| 86 | + # if flags are not empty, append them to the name |
| 87 | + name: cppdap-Linux-${{ matrix.compiler.CC }}-${{ matrix.config }}${{ matrix.sanitizer != '' && '-' || '' }}${{ matrix.sanitizer }} |
48 | 88 | path: out/usr/local/
|
0 commit comments