IMG: make Dockerfile more flexible #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# configuration for GitHub Actions | |
name: gr1c tests | |
on: | |
push: | |
pull_request: | |
jobs: | |
build-and-test: | |
name: Build and test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ | |
ubuntu-22.04, | |
macos-latest, | |
] | |
cc: ['gcc', 'clang'] | |
exclude: | |
- os: macos-latest | |
cc: gcc | |
env: | |
CC: ${{ matrix.cc }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install packages via Brew if macOS | |
if: runner.os == 'macOS' | |
run: | | |
brew install graphviz | |
brew install flex | |
echo '/opt/homebrew/opt/flex/bin' >> $GITHUB_PATH | |
brew install bison | |
echo '/opt/homebrew/opt/bison/bin' >> $GITHUB_PATH | |
- name: Install APT packages if Ubuntu | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt update | |
sudo apt install \ | |
build-essential \ | |
graphviz \ | |
${{ matrix.cc }} | |
- name: Display versions | |
run: | | |
${{ matrix.cc }} --version | |
bison --version | |
flex --version | |
- name: Build dependencies | |
run: | | |
./get-deps.sh | |
./get-extra-deps.sh | |
./build-deps.sh | |
- name: Enable measurement of coverage | |
if: matrix.cc == 'gcc' | |
run: | | |
echo 'COVERAGE=1' >> "$GITHUB_ENV" | |
- name: Build gr1c | |
run: | | |
make -e all | |
- name: Run tests | |
run: | | |
VERBOSE=1 make -e check | |
- name: Report coverage | |
if: matrix.cc == 'gcc' | |
run: | | |
gcov -n $(for k in $(find src exp aux -name \*.c); do basename $k; done) > cov-summary.txt | |
echo "### Coverage summary" >> $GITHUB_STEP_SUMMARY | |
tail -1 cov-summary.txt >> $GITHUB_STEP_SUMMARY |