From f934049b52eaaa0a63c5ce8c37e8621ebf012564 Mon Sep 17 00:00:00 2001 From: Zach Struck Date: Thu, 3 Dec 2020 14:36:27 -0700 Subject: [PATCH 1/5] Create main.yml --- .github/workflows/main.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..6a2b91b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,36 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Run a one-line script + run: echo Hello, world! + + # Runs a set of commands using the runners shell + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. From 58eb451d8d0c96c7c0482696b33d5702429d39a6 Mon Sep 17 00:00:00 2001 From: Zach Date: Thu, 3 Dec 2020 14:56:31 -0700 Subject: [PATCH 2/5] Enable GitHub Actions on all events --- .github/workflows/main.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6a2b91b..f29df41 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,11 +4,9 @@ name: CI # Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch + # Triggers the workflow on push or pull request events push: - branches: [ master ] pull_request: - branches: [ master ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: From c47e686c85ae8f74d54906d4b3cbb6c2df07da04 Mon Sep 17 00:00:00 2001 From: Zach Date: Thu, 3 Dec 2020 15:20:00 -0700 Subject: [PATCH 3/5] GitHub Actions - port CircleCI --- .github/workflows/main.yml | 48 +++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f29df41..47e6c5e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,18 +17,50 @@ jobs: build: # The type of runner that the job will run on runs-on: ubuntu-latest + strategy: + matrix: + compiler: [ clang++ ] + cxx: [ 17 ] # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! - - # Runs a set of commands using the runners shell - - name: Run a multi-line script + # Dependencies + - name: Install build tools + run: | + sudo apt update + sudo apt install -y clang g++ cmake git + - name: Install dependencies + run: | + git clone --depth 1 https://github.com/catchorg/Catch2.git --branch v2.x + cmake \ + -HCatch2 \ + -BCatch2/build \ + -DBUILD_TESTING=OFF \ + -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \ + -DCMAKE_CXX_STANDARD=${{ matrix.cxx }} \ + -DCMAKE_INSTALL_PREFIX:PATH=~/ext + cmake \ + --build Catch2/build/ \ + --target install + - name: Create build files + run: | + cmake \ + -H. \ + -Bbuild \ + -DBUILD_TESTING:BOOL=ON \ + -DCMAKE_BUILD_TYPE:STRING=Debug \ + -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \ + -DCMAKE_CXX_STANDARD=${{ matrix.cxx }} \ + -DCMAKE_PREFIX_PATH:PATH=~/ext + - name: Build code + run: | + cmake \ + --build build \ + --config Debug + - name: Run tests run: | - echo Add other actions to build, - echo test, and deploy your project. + cd build + ctest -C Debug From 3e7f8c0c9ddfcee304dfff4db432e9c7ba64ac2a Mon Sep 17 00:00:00 2001 From: Zach Date: Thu, 3 Dec 2020 16:50:45 -0700 Subject: [PATCH 4/5] GitHub Actions - do matrix --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 47e6c5e..f91bdd1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,8 +19,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - compiler: [ clang++ ] - cxx: [ 17 ] + compiler: [ clang++, g++ ] + cxx: [ 03, 11, 14, 17 ] # Steps represent a sequence of tasks that will be executed as part of the job steps: From 2143923a10144017a9413a4b9a641b775ab2c51f Mon Sep 17 00:00:00 2001 From: Zach Date: Thu, 3 Dec 2020 16:52:19 -0700 Subject: [PATCH 5/5] GitHub Actions - fix C++03 runs --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f91bdd1..bd4daf3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: compiler: [ clang++, g++ ] - cxx: [ 03, 11, 14, 17 ] + cxx: [ 98, 11, 14, 17 ] # Steps represent a sequence of tasks that will be executed as part of the job steps: