Update GitHub Actions workflow to trigger on release creation and fix… #115
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
name: C/C++ CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, fedora-latest, debian-latest] | |
configuration: [ Release, Debug ] | |
compiler: [ gcc, clang ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies on Ubuntu | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y autoconf automake autopoint gettext git libtool make texinfo | |
if [ "${{ matrix.compiler }}" == "gcc" ]; then sudo apt-get install -y g++; fi | |
if [ "${{ matrix.compiler }}" == "clang" ]; then sudo apt-get install -y clang; fi | |
- name: Install dependencies on Fedora | |
if: matrix.os == 'fedora-latest' | |
run: | | |
sudo dnf update -y | |
sudo dnf install -y autoconf automake gettext git libtool make texinfo | |
if [ "${{ matrix.compiler }}" == "gcc" ]; then sudo dnf install -y gcc gcc-c++; fi | |
if [ "${{ matrix.compiler }}" == "clang" ]; then sudo dnf install -y clang; fi | |
- name: Install dependencies on Debian | |
if: matrix.os == 'debian-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y autoconf automake autopoint gettext git libtool make texinfo | |
if [ "${{ matrix.compiler }}" == "gcc" ]; then sudo apt-get install -y g++; fi | |
if [ "${{ matrix.compiler }}" == "clang" ]; then sudo apt-get install -y clang; fi | |
- name: Run autogen | |
run: ./autogen.sh | |
- name: Configure | |
run: | | |
if [ "${{ matrix.compiler }}" == "gcc" ]; then export CC=gcc CXX=g++; fi | |
if [ "${{ matrix.compiler }}" == "clang" ]; then export CC=clang CXX=clang++; fi | |
if [ "${{ matrix.configuration }}" == "Release" ]; then | |
export CFLAGS="-O2" CXXFLAGS="-O2"; | |
else | |
export CFLAGS="-g -O0" CXXFLAGS="-g -O0"; | |
fi | |
./configure | |
- name: Build | |
run: make | |
- name: Run checks | |
run: make check |