built cadaver #177
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: Linux builds | |
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CCACHE_DIR: "/dev/shm/.ccache" | |
CCACHE_MAXSIZE: "64M" | |
CCACHE_COMPRESS: "true" | |
CLAMDB_DIR: "/var/lib/clamav" | |
jobs: | |
build_ubuntu: | |
name: ${{ matrix.conf.name }} | |
runs-on: ${{ matrix.conf.os }} | |
if: github.event_name != 'pull_request' || contains('dreamer,kcgen,ant-222,Wengier', github.actor) == false | |
strategy: | |
matrix: | |
conf: | |
- name: Clang, Ubuntu 20.04 | |
os: ubuntu-20.04 | |
packages: clang | |
build_flags: -Dunit_tests=disabled --native-file=.github/meson/native-clang.ini | |
max_warnings: 500 | |
- name: GCC, Ubuntu 20.04 | |
os: ubuntu-20.04 | |
build_flags: -Dunit_tests=disabled | |
max_warnings: 500 | |
- name: GCC, Ubuntu 18.04 | |
os: ubuntu-18.04 | |
build_flags: -Dunit_tests=disabled | |
max_warnings: 500 | |
- name: GCC 7, Ubuntu 18.04 | |
os: ubuntu-18.04 | |
packages: g++-7 | |
build_flags: -Dunit_tests=disabled --native-file=.github/meson/native-gcc-7.ini | |
max_warnings: 500 | |
- name: GCC, +tests | |
os: ubuntu-20.04 | |
run_tests: true | |
max_warnings: 500 | |
- name: GCC, +debugger | |
os: ubuntu-20.04 | |
build_flags: -Dunit_tests=disabled -Denable_debugger=normal | |
max_warnings: 500 | |
- name: GCC, -dyn-x86 | |
os: ubuntu-20.04 | |
build_flags: -Dunit_tests=disabled -Ddynamic_core=dynrec | |
max_warnings: 500 | |
- name: GCC, -dyn-x86, +debugger | |
os: ubuntu-20.04 | |
build_flags: -Dunit_tests=disabled -Ddynamic_core=dynrec -Denable_debugger=normal | |
max_warnings: 500 | |
- name: GCC, -network | |
os: ubuntu-20.04 | |
build_flags: -Dunit_tests=disabled -Duse_sdl2_net=false -Duse_slirp=false | |
max_warnings: 500 | |
- name: GCC, minimum build | |
os: ubuntu-20.04 | |
build_flags: >- | |
--wrap-mode=nofallback | |
-Dunit_tests=disabled | |
-Duse_alsa=false | |
-Duse_fluidsynth=false | |
-Duse_mt32emu=false | |
-Duse_opengl=false | |
-Duse_png=false | |
-Duse_sdl2_net=false | |
-Duse_slirp=false | |
min_dependencies: true | |
max_warnings: 500 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- run: sudo apt-get update | |
- name: Install dependencies (minimum set) | |
if: matrix.conf.min_dependencies | |
run: | | |
sudo apt-get install -y build-essential ccache libsdl2-dev libsdl2-mixer-dev libopusfile-dev python3-setuptools | |
sudo pip3 install --upgrade meson ninja | |
- name: Install dependencies | |
if: matrix.conf.min_dependencies != true | |
run: | | |
sudo apt-get install -y \ | |
${{ matrix.conf.packages }} \ | |
$(cat ./.github/packages/${{ matrix.conf.os }}-apt.txt) | |
sudo pip3 install --upgrade meson ninja | |
- name: Prepare compiler cache | |
id: prep-ccache | |
shell: bash | |
run: | | |
mkdir -p "${CCACHE_DIR}" | |
echo "::set-output name=dir::$CCACHE_DIR" | |
echo "::set-output name=today::$(date -I)" | |
echo "::set-output name=yesterday::$(date --date=yesterday -I)" | |
echo "::set-output name=name_hash::$(echo '${{ matrix.conf.name }}' | shasum | cut -b-8)" | |
- uses: actions/cache@v2 | |
id: cache-ccache | |
with: | |
path: ${{ steps.prep-ccache.outputs.dir }} | |
key: ccache-${{ matrix.conf.os }}-${{ steps.prep-ccache.outputs.name_hash }}-${{ steps.prep-ccache.outputs.today }}-1 | |
restore-keys: | | |
ccache-${{ matrix.conf.os }}-${{ steps.prep-ccache.outputs.name_hash }}-${{ steps.prep-ccache.outputs.yesterday }}-1 | |
- name: Cache subprojects | |
uses: actions/cache@v2 | |
with: | |
path: subprojects/packagecache | |
key: subprojects-${{ hashFiles('subprojects/*.wrap') }} | |
- name: Log environment | |
run: ./scripts/log-env.sh | |
- run: meson setup ${{ matrix.conf.build_flags }} build | |
- name: Build | |
run: | | |
set -xo pipefail | |
ninja -C build |& tee build.log | |
ccache -s | |
- name: Run tests | |
if: matrix.conf.run_tests | |
run: meson test -C build --print-errorlogs | |
- name: Summarize warnings | |
if: matrix.conf.run_tests != true | |
env: | |
MAX_WARNINGS: ${{ matrix.conf.max_warnings }} | |
run: ./scripts/count-warnings.py -lf build.log | |
build_linux_release: | |
name: Release build | |
runs-on: ubuntu-18.04 | |
if: github.event_name != 'pull_request' || contains('dreamer,kcgen,ant-222,Wengier', github.actor) == false | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- run: sudo apt-get update | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y tree \ | |
$(cat ./.github/packages/ubuntu-18.04-apt.txt) | |
sudo pip3 install --upgrade meson ninja | |
- name: Prepare compiler cache | |
id: prep-ccache | |
shell: bash | |
run: | | |
mkdir -p "${CCACHE_DIR}" | |
echo "::set-output name=dir::$CCACHE_DIR" | |
echo "::set-output name=today::$(date -I)" | |
echo "::set-output name=yesterday::$(date --date=yesterday -I)" | |
- uses: actions/cache@v2 | |
id: cache-ccache | |
with: | |
path: ${{ steps.prep-ccache.outputs.dir }} | |
key: ccache-linux-release-${{ steps.prep-ccache.outputs.today }}-1 | |
restore-keys: | | |
ccache-linux-release-${{ steps.prep-ccache.outputs.yesterday }}-1 | |
- name: Cache subprojects | |
uses: actions/cache@v2 | |
with: | |
path: subprojects/packagecache | |
key: subprojects-${{ hashFiles('subprojects/*.wrap') }}-1 | |
- name: Log environment | |
run: ./scripts/log-env.sh | |
- name: Inject version string | |
run: | | |
set -x | |
git fetch --prune --unshallow | |
export VERSION=$(git describe --abbrev=5) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Setup release build | |
run: | | |
meson setup \ | |
--wrap-mode=forcefallback \ | |
-Dbuildtype=release \ | |
-Ddefault_library=static \ | |
-Db_asneeded=true \ | |
-Db_lto=true \ | |
-Dfluidsynth:try-static-deps=true \ | |
build | |
- name: Build | |
run: ninja -C build | |
- name: Package | |
run: | | |
./scripts/create-package.sh \ | |
-p linux \ | |
build \ | |
"dosbox-staging-linux-$VERSION" | |
- name: Create tarball | |
run: tar -cJf "dosbox-staging-linux-$VERSION.tar.xz" "dosbox-staging-linux-$VERSION" | |
- name: Prepare Clam AV DB cache | |
id: prep-clamdb | |
shell: bash | |
run: | | |
sudo mkdir -p "${CLAMDB_DIR}" | |
sudo chmod 777 "${CLAMDB_DIR}" | |
echo "::set-output name=today::$(date -I)" | |
echo "::set-output name=yesterday::$(date --date=yesterday -I)" | |
- uses: actions/cache@v2 | |
id: cache-clamdb | |
with: | |
path: ${{ env.CLAMDB_DIR }}/*.cvd | |
key: clamdb-linux-${{ steps.prep-clamdb.outputs.today }}-1 | |
restore-keys: | | |
clamdb-linux-${{ steps.prep-clamdb.outputs.yesterday }}-1 | |
- name: Clam AV scan | |
run: | | |
set -x | |
sudo apt-get install clamav | |
sudo systemctl stop clamav-freshclam | |
sudo sed -i 's/30/20000/g' /etc/clamav/freshclam.conf | |
sudo freshclam --foreground | |
clamscan --heuristic-scan-precedence=yes --recursive --infected . | |
- name: Upload tarball | |
uses: actions/upload-artifact@v2 | |
# GitHub automatically zips the artifacts (there's no way to create | |
# a tarball), and it removes all executable flags while zipping. | |
# Letting it zip a tarball preserves flags in the compressed files. | |
with: | |
name: dosbox-staging-linux-x86_64 | |
path: dosbox-staging-linux-${{ env.VERSION }}.tar.xz | |
# This job exists only to publish an artifact with version info when building | |
# from main branch, so snapshot build version will be visible on: | |
# https://dosbox-staging.github.io/downloads/devel/ | |
# | |
publish_additional_artifacts: | |
name: Publish additional artifacts | |
needs: build_linux_release | |
runs-on: ubuntu-18.04 | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Generate changelog | |
run: | | |
set +x | |
git fetch --unshallow | |
VERSION=$(git describe --abbrev=4) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
NEWEST_TAG=$(git describe --abbrev=0) | |
git log "$NEWEST_TAG..HEAD" > changelog-$VERSION.txt | |
- uses: actions/upload-artifact@v2 | |
with: | |
# Keep exactly this artifact name; it's being used to propagate | |
# version info via GitHub REST API | |
name: changelog-${{ env.VERSION }}.txt | |
path: changelog-${{ env.VERSION }}.txt |