From 5ccf929d09dfc57f20848d203f61b946b4ce05b7 Mon Sep 17 00:00:00 2001 From: Simon Weis Date: Fri, 23 Aug 2024 07:01:29 +0200 Subject: [PATCH] Add workflows --- .github/workflows/cpp.yml | 38 ++++++++++++++++++++++++++++++++++++ .github/workflows/python.yml | 31 +++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/workflows/cpp.yml create mode 100644 .github/workflows/python.yml diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml new file mode 100644 index 0000000..886a7a3 --- /dev/null +++ b/.github/workflows/cpp.yml @@ -0,0 +1,38 @@ +name: Validate C++ + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +jobs: + UnitTests: + runs-on: ubuntu-latest + + steps: + - name: Set up cmake + uses: jwlawson/actions-setup-cmake@v1.10 + with: + cmake-version: '3.19.x' + + - name: Set up gcc + uses: egor-tensin/setup-gcc@v1 + with: + version: 9 + platform: x64 + + - uses: actions/checkout@v2 + + - name: CMake + working-directory: ${{github.workspace}}/cpp + run: cmake -B ${{github.workspace}}/build . + + - name: Build + working-directory: ${{github.workspace}}/build + run: make + + - name: Test + working-directory: ${{github.workspace}}/build + run: ./unittests diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..8365bcc --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,31 @@ +name: Validate Python + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install dependencies + working-directory: ${{github.workspace}}/python + run: | + pip install -r requirements.txt + + - name: run pytests + working-directory: ${{github.workspace}}/python + run: | + python -m pytest +