Skip to content

Commit

Permalink
Update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Pusnow committed Jan 7, 2022
1 parent 7b2abad commit 69cf18b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 38 deletions.
63 changes: 33 additions & 30 deletions .github/workflows/test-linux-extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,54 @@ env:
BUILD_TYPE: Release

jobs:
build:
tests:
strategy:
matrix:
image: ["ubuntu:18.04", "ubuntu:20.04"]

runs-on: ubuntu-20.04
config:
[
{ image: "debian:10", pm: "apt" },
{ image: "debian:11", pm: "apt" },
{ image: "ubuntu:20.04", pm: "apt" },
{ image: "ubuntu:21.04", pm: "apt" },
{ image: "ubuntu:21.10", pm: "apt" },
{ image: "centos:8", pm: "yum" },
{ image: "fedora:35", pm: "yum" },
{ image: "fedora:34", pm: "yum" },
{ image: "fedora:33", pm: "yum" },
{ image: "almalinux:8", pm: "yum" },
{ image: "rockylinux:8", pm: "yum" },
]

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- uses: docker://${{ matrix.image }}
- name: Setup Docker Container
run: docker run --rm -d -it --name kens-test -v ${{github.workspace}}:/test ${{ matrix.config.image }}

- name: Install g++ gcc
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: sudo apt update && sudo apt install -y g++ gcc
- name: Install g++ gcc (APT)
if: matrix.config.pm == 'apt'
run: docker exec kens-test bash -c "apt update && apt install -y cmake g++ gcc ca-certificates"

- name: Install g++ gcc (YUM)
if: matrix.config.pm == 'yum'
run: docker exec kens-test bash -c "yum -y install cmake gcc-c++ gcc ca-certificates"

- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
run: docker exec kens-test bash -c "cmake -E make_directory /test/build"

- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE

run: docker exec kens-test bash -c "cd /test/build && cmake /test -DCMAKE_BUILD_TYPE=$BUILD_TYPE"

- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
run: docker exec kens-test bash -c "cd /test/build && cmake --build . --config $BUILD_TYPE"

- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: ./app/kens/kens-all-run-solution

run: docker exec kens-test bash -c "/test/build/app/kens/kens-all-run-solution"

- name: Test (Unreliable)
working-directory: ${{github.workspace}}/build
shell: bash
run: ./app/kens/kens-all-unreliable-run-solution
run: docker exec kens-test bash -c "/test/build/app/kens/kens-all-unreliable-run-solution"
14 changes: 6 additions & 8 deletions .github/workflows/test-wsl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
branches:
- master

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
Expand All @@ -25,24 +22,25 @@ jobs:
- name: Install g++ gcc
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: sudo apt update && sudo apt install -y cmake g++-${{ matrix.gcc }} gcc-${{ matrix.gcc }}
run: sudo apt update && sudo apt install -y cmake g++ gcc

- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
working-directory: ${{github.workspace}}
run: cmake -E make_directory build

- name: Configure CMake
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_C_COMPILER=gcc-${{ matrix.gcc }} -DCMAKE_CXX_COMPILER=g++-${{ matrix.gcc }}
run: cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++

- name: Build
working-directory: ${{github.workspace}}/build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
run: cmake --build . --config Release

- name: Test
working-directory: ${{github.workspace}}/build
Expand All @@ -51,4 +49,4 @@ jobs:

- name: Test (Unreliable)
working-directory: ${{github.workspace}}/build
run: ./app/kens/kens-all-unreliable-run-solution
run: ./app/kens/kens-all-unreliable-run-solution

0 comments on commit 69cf18b

Please sign in to comment.