workflows: Build packages on more operating systems

This commit is contained in:
Tom Stellard 2021-06-05 22:33:36 -07:00
parent dd115a7e69
commit e16a5077ca
1 changed files with 44 additions and 31 deletions

View File

@ -10,35 +10,56 @@ on:
env:
BYGFOOT_VERSION: "2.3.3-unofficial-git-${{ github.sha }}"
UBUNTU_BUILD_DEPENDENCIES: libglib2.0-dev libgtk2.0-dev libpango1.0-dev libatk1.0-dev libfreetype6-dev ninja-build cmake libjson-c-dev unzip
# Install the libjson-c-dev package, because the ubuntu library packages are versioned.
UBUNTU_DEPENDENCIES: libglib2.0 libgtk2.0 libpango1.0 libatk1.0 libfreetype6 libjson-c-dev
LINUX_BUILD_DEPENDENCIES: libglib2.0-dev libgtk2.0-dev libpango1.0-dev libatk1.0-dev libfreetype6-dev ninja-build cmake
jobs:
package-linux:
runs-on:
- ubuntu-16.04
container:
image: ${{ matrix.container-image }}
strategy:
fail-fast: false
matrix:
build-type:
- full
- minimal
include:
- build-type: full
extra-deps: libjson-c-dev
build-suffix: ""
- build-type: minimal
extra-deps: ""
build-suffix: -minimal
- name: ubuntu-16.04
container-image: docker.io/ubuntu:16.04
dependencies: "$UBUNTU_BUILD_DEPENDENCIES"
test: true
- name: ubuntu-18.04
container-image: docker.io/ubuntu:18.04
dependencies: "$UBUNTU_BUILD_DEPENDENCIES"
test: true
- name: ubuntu-20.04
container-image: docker.io/ubuntu:20.04
dependencies: "$UBUNTU_BUILD_DEPENDENCIES"
test: true
- name: ubuntu-20.10
container-image: docker.io/ubuntu:20.10
dependencies: "$UBUNTU_BUILD_DEPENDENCIES"
test: true
- name: ubuntu-21.04
container-image: docker.io/ubuntu:21.04
dependencies: "$UBUNTU_BUILD_DEPENDENCIES"
test: true
- name: linux
container-image: docker.io/ubuntu:16.04
dependencies: "$LINUX_BUILD_DEPENDENCIES"
test: false
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get install libglib2.0-dev libgtk2.0-dev libpango1.0-dev libatk1.0-dev libfreetype6-dev ninja-build
- name: Install extra dependencies
if: ${{ matrix.extra-deps != '' }}
run: sudo apt-get install ${{ matrix.extra-deps }}
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get update
apt-get -y install ${{ matrix.dependencies }}
- name: Package Bygfoot
run: ./scripts/package.sh .
@ -46,30 +67,22 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: "bygfoot-${{ env.BYGFOOT_VERSION }}-linux${{ matrix.build-suffix }}"
name: "bygfoot-${{ env.BYGFOOT_VERSION }}-${{ matrix.name }}"
path: "*.bz2"
test-linux:
needs:
- package-linux
runs-on:
- ubuntu-16.04
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
if: ${{ github.event_name == 'pull_request' && matrix.test }}
with:
name: "bygfoot-${{ env.BYGFOOT_VERSION }}-linux"
- name: Unpack binary package
run: |
ls
tar -xjf bygfoot-${{ env.BYGFOOT_VERSION }}.tar.bz2
path: tests-${{ matrix.name }}
name: "bygfoot-${{ env.BYGFOOT_VERSION }}-${{ matrix.name }}"
- name: Run Tests
if: ${{ github.event_name == 'pull_request' && matrix.test }}
working-directory: tests-${{ matrix.name }}
run: |
bash ./test/test-load-save.sh ./bygfoot-${{ env.BYGFOOT_VERSION }}/bygfoot
bash ./test/test-country-defs.sh ./bygfoot-${{ env.BYGFOOT_VERSION }}/bygfoot || true
tar -xjf bygfoot-${{ env.BYGFOOT_VERSION }}.tar.bz2
bash ../test/test-load-save.sh ./bygfoot-${{ env.BYGFOOT_VERSION }}/bygfoot
bash ../test/test-country-defs.sh ./bygfoot-${{ env.BYGFOOT_VERSION }}/bygfoot || true
package-windows: