Imported Upstream version 1.10.1
[platform/upstream/ninja.git] / .github / workflows / macos.yml
1 name: macOS
2
3 on:
4   pull_request:
5   push:
6   release:
7     types: published
8
9 jobs:
10   build:
11     runs-on: macOS-latest
12
13     steps:
14     - uses: actions/checkout@v2
15
16     - name: Install dependencies
17       run: brew install re2c p7zip cmake
18
19     - name: Build ninja
20       shell: bash
21       env:
22         MACOSX_DEPLOYMENT_TARGET: 10.12
23       run: |
24         cmake -DCMAKE_BUILD_TYPE=Release -B build
25         cmake --build build --parallel --config Release
26
27     - name: Test ninja
28       run: ctest -vv
29       working-directory: build
30
31     - name: Create ninja archive
32       shell: bash
33       run: |
34         mkdir artifact
35         7z a artifact/ninja-mac.zip ./build/ninja
36
37     # Upload ninja binary archive as an artifact
38     - name: Upload artifact
39       uses: actions/upload-artifact@v1
40       with:
41         name: ninja-binary-archives
42         path: artifact
43
44     - name: Upload release asset
45       if: github.event.action == 'published'
46       uses: actions/upload-release-asset@v1.0.1
47       env:
48         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49       with:
50         upload_url: ${{ github.event.release.upload_url }}
51         asset_path: ./artifact/ninja-mac.zip
52         asset_name: ninja-mac.zip
53         asset_content_type: application/zip