99 container : ghcr.io/opencyphal/toolshed:ts24.4.3
1010 strategy :
1111 matrix :
12- toolchain : [ ' clang', ' gcc' ]
12+ toolchain : [ " clang", " gcc" ]
1313 include :
1414 - toolchain : gcc
1515 c-compiler : gcc
@@ -24,23 +24,28 @@ jobs:
2424 # language=bash
2525 - run : >
2626 cmake
27- -B ${{ github.workspace }} /build
27+ -B $GITHUB_WORKSPACE /build
2828 -DCMAKE_BUILD_TYPE=Debug
2929 -DCMAKE_C_COMPILER=${{ matrix.c-compiler }}
3030 -DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }}
3131 .
3232 # language=bash
3333 - run : |
34- cd ${{ github.workspace }} /build
34+ cd $GITHUB_WORKSPACE /build
3535 make VERBOSE=1 -j$(nproc)
3636 make test ARGS="--verbose"
37+ - name : Archive workspace
38+ if : always()
39+ run : |
40+ cd $GITHUB_WORKSPACE
41+ tar --use-compress-program="gzip -9" -cf $RUNNER_TEMP/workspace.tar.gz .
3742 - uses : actions/upload-artifact@v4
3843 if : always()
3944 with :
4045 # The matrix is shown for convenience but this is fragile because the values may not be string-convertible.
4146 # Shall it break one day, feel free to remove the matrix from here.
4247 name : ${{github.job}}-#${{strategy.job-index}}-${{job.status}}-${{join(matrix.*, ',')}}
43- path : ${{github.workspace }}/**/*
48+ path : ${{runner.temp }}/workspace.tar.gz
4449 retention-days : 2
4550
4651 optimizations :
@@ -49,13 +54,13 @@ jobs:
4954 container : ghcr.io/opencyphal/toolshed:ts24.4.3
5055 strategy :
5156 matrix :
52- toolchain : [ ' clang', ' gcc' ]
57+ toolchain : [ " clang", " gcc" ]
5358 build_type : [ Release, MinSizeRel ]
5459 include :
5560 - toolchain : gcc
5661 c-compiler : gcc
5762 cxx-compiler : g++
58- cxx-flags : -fno-strict-aliasing # GCC in MinSizeRel C++20 mode misoptimizes the Cavl test.
63+ cxx-flags : " "
5964 - toolchain : clang
6065 c-compiler : clang
6166 cxx-compiler : clang++
6671 # language=bash
6772 - run : >
6873 cmake
69- -B ${{ github.workspace }} /build
74+ -B $GITHUB_WORKSPACE /build
7075 -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
7176 -DCMAKE_C_COMPILER=${{ matrix.c-compiler }}
7277 -DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }}
@@ -75,35 +80,68 @@ jobs:
7580 .
7681 # language=bash
7782 - run : |
78- cd ${{ github.workspace }} /build
83+ cd $GITHUB_WORKSPACE /build
7984 make VERBOSE=1 -j$(nproc)
8085 make test ARGS="--verbose"
86+ - name : Archive workspace
87+ if : always()
88+ run : |
89+ cd $GITHUB_WORKSPACE
90+ tar --use-compress-program="gzip -9" -cf $RUNNER_TEMP/workspace.tar.gz .
8191 - uses : actions/upload-artifact@v4
8292 if : always()
8393 with :
8494 # The matrix is shown for convenience but this is fragile because the values may not be string-convertible.
8595 # Shall it break one day, feel free to remove the matrix from here.
8696 name : ${{github.job}}-#${{strategy.job-index}}-${{job.status}}-${{join(matrix.*, ',')}}
87- path : ${{github.workspace }}/**/*
97+ path : ${{runner.temp }}/workspace.tar.gz
8898 retention-days : 2
8999
90- avr :
100+ coverage :
91101 if : github.event_name == 'push'
92102 runs-on : ubuntu-latest
93- env :
94- mcu : at90can64
95- flags : -Wall -Wextra -Werror -pedantic -Wconversion -Wtype-limits
96- strategy :
97- matrix :
98- std : [ 'c99', 'c11', 'gnu99', 'gnu11' ]
103+ container : ghcr.io/opencyphal/toolshed:ts24.4.3
99104 steps :
100105 - uses : actions/checkout@v4
106+ with :
107+ submodules : true
108+ # language=bash
109+ - run : >
110+ cmake -B $GITHUB_WORKSPACE/build -DCMAKE_BUILD_TYPE=Debug -DNO_STATIC_ANALYSIS=ON -DENABLE_COVERAGE=ON .
101111 # language=bash
102112 - run : |
103- sudo apt update -y && sudo apt upgrade -y
104- sudo apt install gcc-avr avr-libc
105- avr-gcc --version
106- - run : avr-gcc libudpard/*.c -c -std=${{matrix.std}} -mmcu=${{env.mcu}} ${{env.flags}}
113+ cd $GITHUB_WORKSPACE/build
114+ make -j$(nproc) && make test && make coverage
115+ - name : Archive workspace
116+ if : always()
117+ run : |
118+ cd $GITHUB_WORKSPACE
119+ tar --use-compress-program="gzip -9" -cf $RUNNER_TEMP/workspace.tar.gz .
120+ - uses : actions/upload-artifact@v4
121+ if : always()
122+ with :
123+ name : ${{github.job}}-#${{strategy.job-index}}-${{job.status}}
124+ path : ${{runner.temp}}/workspace.tar.gz
125+ retention-days : 30
126+
127+ # TODO: re-enable this
128+ # avr:
129+ # if: github.event_name == 'push'
130+ # runs-on: ubuntu-latest
131+ # env:
132+ # mcu: at90can64
133+ # flags: -Wall -Wextra -Werror -pedantic -Wconversion -Wtype-limits
134+ # strategy:
135+ # matrix:
136+ # std: [ 'c99', 'c11', 'gnu99', 'gnu11' ]
137+ # steps:
138+ # - uses: actions/checkout@v4
139+ # # language=bash
140+ # - run: |
141+ # sudo apt update -y && sudo apt upgrade -y
142+ # sudo apt install gcc-avr avr-libc
143+ # avr-gcc --version
144+ # - run: avr-gcc -Ilib/cavl/ libudpard/*.c -c -std=${{matrix.std}} -mmcu=${{env.mcu}} ${{env.flags}}
107145
108146 arm :
109147 if : github.event_name == 'push'
@@ -112,14 +150,14 @@ jobs:
112150 flags : -Wall -Wextra -Werror -pedantic -Wconversion -Wtype-limits -Wcast-align -Wfatal-errors
113151 strategy :
114152 matrix :
115- std : [ ' c99', ' c11', ' gnu99', ' gnu11' ]
153+ std : [ " c99", " c11", " gnu99", " gnu11" ]
116154 steps :
117155 - uses : actions/checkout@v4
118156 # language=bash
119157 - run : |
120158 sudo apt update -y && sudo apt upgrade -y
121159 sudo apt-get install -y gcc-arm-none-eabi
122- - run : arm-none-eabi-gcc libudpard/*.c -c -std=${{matrix.std}} ${{ env.flags }}
160+ - run : arm-none-eabi-gcc -Ilib/cavl/ libudpard/*.c -c -std=${{matrix.std}} ${{ env.flags }}
123161
124162 sonar :
125163 runs-on : ubuntu-latest
@@ -138,12 +176,12 @@ jobs:
138176 steps :
139177 - uses : actions/checkout@v4
140178 with :
141- fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
179+ fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
142180 submodules : true
143181 - uses : actions/setup-java@v4
144182 with :
145183 java-version : 17
146- distribution : ' zulu'
184+ distribution : " zulu"
147185 # language=bash
148186 - run : |
149187 clang --version
@@ -178,6 +216,6 @@ jobs:
178216 - uses : actions/checkout@v4
179217 - uses : DoozyX/clang-format-lint-action@v0.20
180218 with :
181- source : ' ./libudpard ./tests'
182- extensions : ' c,h,cpp,hpp'
219+ source : " ./libudpard ./tests"
220+ extensions : " c,h,cpp,hpp"
183221 clangFormatVersion : ${{ env.LLVM_VERSION }}
0 commit comments