From 58857e25e21804a4c873636d05d076a5a89cce6d Mon Sep 17 00:00:00 2001 From: Patryk Obara Date: Fri, 20 Sep 2019 20:53:19 +0200 Subject: [PATCH] Create initial GitHub Workflows setup So far it consists of following builds: - GCC 9.1 (Ubuntu 18.04) - GCC 8.3 (Ubuntu 18.04) - GCC 7.4 (Ubuntu 18.04 default) - GCC 5.4 (Ubuntu 16.04 default) - Clang 10.0 (macOS 10.14 Mojave default) - Clang 6.0 (Ubuntu 18.04) Workflow also defines static code analysis using Clang 6 (Ubuntu 18.04), which does not indicate results directly in PRs yet, but uploads a static analysis report as a build artifact. --- .github/workflows/compilation.yml | 97 +++++++++++++++++++++++++++++++ .github/workflows/static.yml | 29 +++++++++ 2 files changed, 126 insertions(+) create mode 100644 .github/workflows/compilation.yml create mode 100644 .github/workflows/static.yml diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml new file mode 100644 index 00000000..fe372f45 --- /dev/null +++ b/.github/workflows/compilation.yml @@ -0,0 +1,97 @@ +name: Compilation + +on: [push] + +jobs: + + build_gcc9: + name: "GCC 9 (ubuntu-18.04)" + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + - name: "Install packages" + run: sudo apt-get install g++-9 libsdl1.2-dev libsdl-net1.2-dev libsdl-sound1.2-dev + - name: Build + env: + CC: gcc-9 + CXX: g++-9 + run: | + # build steps + set -x + $CXX --version + ./autogen.sh + ./configure + make -j "$(nproc)" + + build_gcc8: + name: "GCC 8 (ubuntu-18.04)" + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + - name: "Install packages" + run: sudo apt-get install g++-8 libsdl1.2-dev libsdl-net1.2-dev libsdl-sound1.2-dev + - name: Build + env: + CC: gcc-8 + CXX: g++-8 + run: | + # build steps + set -x + $CXX --version + ./autogen.sh + ./configure + make -j "$(nproc)" + + build_ubuntu: + name: "GCC" + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, ubuntu-16.04] + steps: + - uses: actions/checkout@v1 + - name: "Install packages" + run: sudo apt-get install libsdl1.2-dev libsdl-net1.2-dev libsdl-sound1.2-dev + - name: Build + run: | + # build steps + set -x + g++ --version + ./autogen.sh + ./configure + make -j "$(nproc)" + + build_clang: + name: "Clang 6 (ubuntu-18.04)" + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + - name: "Install packages" + run: sudo apt-get install libsdl1.2-dev libsdl-net1.2-dev libsdl-sound1.2-dev + - name: Build + env: + CC: clang + CXX: clang++ + run: | + # build steps + set -x + $CXX --version + ./autogen.sh + ./configure + make -j "$(nproc)" + + build_macos: + name: "Clang (macOS-10.14)" + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + - name: "Install packages" + run: brew install automake libpng sdl sdl_net sdl_sound + - name: Build + run: | + # build steps + set -x + clang++ --version + ./autogen.sh + ./configure + make -j "$(sysctl -n hw.physicalcpu)" diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 00000000..a59a29f5 --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,29 @@ +name: Static code analysis + +on: [push] + +jobs: + + build_clang_static_analyser: + name: "Clang static analyzer" + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + - name: "Install packages" + run: sudo apt-get install libsdl1.2-dev libsdl-net1.2-dev libsdl-sound1.2-dev python3-setuptools + - name: "Install scan-build (Python version)" + run: sudo pip3 install scan-build + - name: Build + run: | + # build steps + set -x + g++ --version + ./autogen.sh + ./configure + intercept-build make -j "$(nproc)" + - name: Analyze + run: analyze-build -v -o report --html-title="dosbox-staging (${GITHUB_SHA:0:8})" + - uses: actions/upload-artifact@master + with: + name: report + path: report