Build on non-Ubuntu Linux using Docker #201
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
## | |
## Copyright (c) 2022 Sebastian Pipping <[email protected]> | |
## | |
## This program is free software; you can redistribute it and/or modify | |
## it under the terms of the GNU General Public License as published by | |
## the Free Software Foundation; either version 2 of the License, or | |
## (at your option) any later version. | |
## | |
## This program is distributed in the hope that it will be useful, | |
## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
## GNU General Public License for more details. | |
## | |
## You should have received a copy of the GNU General Public License | |
## along with this program. If not, see <http://www.gnu.org/licenses/>. | |
name: Build on non-Ubuntu Linux using Docker | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 4 * * 5' # Every Friday at 4am | |
# Drop permissions to minimum for security | |
permissions: | |
contents: read | |
jobs: | |
build_docker: | |
strategy: | |
fail-fast: false | |
matrix: | |
linux_distro: | |
- Alpine Linux 3.20 # with musl | |
- CentOS 8.2 # with GCC 8.5.0 | |
- Debian Buster with GCC 9.2 # stock buster has GCC 8.3 | |
- Ubuntu 22.04 # because super popular | |
- openSUSE Tumbleweed # because GCC 13+ | |
name: Build on ${{ matrix.linux_distro }} using Docker | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Build on ${{ matrix.linux_distro }} using Docker | |
run: | | |
set -x | |
# Create tarballs used by Dockerfile | |
git submodule update --init | |
git archive -o usbguard.tar HEAD | |
( cd src/ThirdParty/PEGTL/ && git archive -o ../../../pegtl.tar HEAD ) | |
( cd src/ThirdParty/Catch/ && git archive -o ../../../catch.tar HEAD ) | |
# Build using Docker | |
linux_distro="$(tr '[:upper:]' '[:lower:]' <<<"${{ matrix.linux_distro }}" | sed 's,[ .],_,g')" | |
docker build -f scripts/docker/build_on_"${linux_distro}".Dockerfile . |