Skip to content

CI: macOS: try alt PATH assignment #43

CI: macOS: try alt PATH assignment

CI: macOS: try alt PATH assignment #43

Workflow file for this run

---
# 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 'export PATH="/opt/homebrew/opt/flex/bin:$PATH"' >> $HOME/.bash_profile
brew install bison
echo 'export PATH="/opt/homebrew/opt/bison/bin:$PATH"' >> $HOME/.bash_profile
- 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