From 8be5de2e87698d6024eb21de8e893c247e77059c Mon Sep 17 00:00:00 2001 From: Mateusz Masiarz Date: Mon, 9 Sep 2024 13:26:51 +0200 Subject: [PATCH] Add tests and release job for macOS (#4) * Add tests and release job for macos * Fix gcc installation * Remove sanitizers on macos --- .github/workflows/release-macos.yaml | 31 ++++++++++++++++++++++++++++ .github/workflows/test-macos.yaml | 26 +++++++++++++++++++++++ tester.cc | 1 + 3 files changed, 58 insertions(+) create mode 100644 .github/workflows/release-macos.yaml create mode 100644 .github/workflows/test-macos.yaml diff --git a/.github/workflows/release-macos.yaml b/.github/workflows/release-macos.yaml new file mode 100644 index 0000000..e9c193f --- /dev/null +++ b/.github/workflows/release-macos.yaml @@ -0,0 +1,31 @@ +on: + release: + types: [published] +permissions: + contents: write +jobs: + upload: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Pull submodules + run: git submodule update --init --recursive + - name: Set up Homebrew + uses: Homebrew/actions/setup-homebrew@master + - name: Install dependencies + run: | + brew install meson ninja gcc@13 + - name: Build + run: | + CXX=g++-13 meson setup build --debug --warnlevel 3 --werror -Dcpp_debugstl=true + ninja -C build + - name: Test + run: | + ninja -C build test + - name: Upload to release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + mv build/oicompare oicompare-arm64 + gh release upload ${{ github.event.release.tag_name }} oicompare-arm64 diff --git a/.github/workflows/test-macos.yaml b/.github/workflows/test-macos.yaml new file mode 100644 index 0000000..f9ae5c6 --- /dev/null +++ b/.github/workflows/test-macos.yaml @@ -0,0 +1,26 @@ +name: test-macos +run-name: Run tests on ARM macOS +on: + push: + branches: ['master'] + pull_request: +jobs: + test: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Pull submodules + run: git submodule update --init --recursive + - name: Set up Homebrew + uses: Homebrew/actions/setup-homebrew@master + - name: Install dependencies + run: | + brew install meson ninja gcc@13 + - name: Build + run: | + CXX=g++-13 meson setup build --debug --warnlevel 3 --werror -Dcpp_debugstl=true + ninja -C build + - name: Test + run: | + ninja -C build test diff --git a/tester.cc b/tester.cc index 7746c2f..8619989 100644 --- a/tester.cc +++ b/tester.cc @@ -6,6 +6,7 @@ #include #include #include +#include #include