summaryrefslogtreecommitdiff
path: root/.github/workflows/macos.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/macos.yml')
-rw-r--r--.github/workflows/macos.yml49
1 files changed, 49 insertions, 0 deletions
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
new file mode 100644
index 0000000..2a7c100
--- /dev/null
+++ b/.github/workflows/macos.yml
@@ -0,0 +1,49 @@
+name: macOS
+
+on:
+ pull_request:
+ push:
+ release:
+ types: published
+
+jobs:
+ build:
+ runs-on: macOS-latest
+
+ steps:
+ - uses: actions/checkout@v1
+
+ - name: Install dependencies
+ run: brew install re2c p7zip cmake
+
+ - name: Build ninja
+ shell: bash
+ run: |
+ mkdir build && cd build
+ cmake -DCMAKE_BUILD_TYPE=Release ..
+ cmake --build . --parallel --config Release
+ ctest -vv
+
+ - name: Create ninja archive
+ shell: bash
+ run: |
+ mkdir artifact
+ 7z a artifact/ninja-mac.zip ./build/ninja
+
+ # Upload ninja binary archive as an artifact
+ - name: Upload artifact
+ uses: actions/upload-artifact@v1
+ with:
+ name: ninja-binary-archives
+ path: artifact
+
+ - name: Upload release asset
+ if: github.event.action == 'published'
+ uses: actions/upload-release-asset@v1.0.1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ github.event.release.upload_url }}
+ asset_path: ./artifact/ninja-mac.zip
+ asset_name: ninja-mac.zip
+ asset_content_type: application/zip