2020-01-17 23:50:10 +01:00
|
|
|
name: Windows
|
2019-10-30 19:52:32 -07:00
|
|
|
|
2019-10-30 22:30:12 -07:00
|
|
|
on:
|
2019-11-16 10:15:50 -08:00
|
|
|
pull_request:
|
2019-10-30 22:30:12 -07:00
|
|
|
push:
|
|
|
|
release:
|
|
|
|
types: published
|
2019-10-30 19:52:32 -07:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2020-01-17 23:50:10 +01:00
|
|
|
runs-on: windows-latest
|
2019-10-30 19:52:32 -07:00
|
|
|
|
|
|
|
steps:
|
2020-02-19 06:05:44 -05:00
|
|
|
- uses: actions/checkout@v2
|
2019-11-14 22:25:18 -08:00
|
|
|
|
2020-01-17 23:50:10 +01:00
|
|
|
- name: Install dependencies
|
2019-10-30 19:52:32 -07:00
|
|
|
run: choco install re2c
|
2019-11-14 22:25:18 -08:00
|
|
|
|
2019-10-30 19:52:32 -07:00
|
|
|
- name: Build ninja
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2021-02-11 18:18:02 +01:00
|
|
|
cmake -Bbuild
|
|
|
|
cmake --build build --parallel --config Debug
|
2020-02-19 06:05:21 -05:00
|
|
|
cmake --build build --parallel --config Release
|
|
|
|
|
2021-02-11 18:18:02 +01:00
|
|
|
- name: Test ninja (Debug)
|
|
|
|
run: .\ninja_test.exe
|
|
|
|
working-directory: build/Debug
|
|
|
|
|
|
|
|
- name: Test ninja (Release)
|
2020-06-15 09:26:20 +02:00
|
|
|
run: .\ninja_test.exe
|
2020-06-15 09:33:53 +02:00
|
|
|
working-directory: build/Release
|
2019-11-14 22:25:18 -08:00
|
|
|
|
2019-10-30 22:30:12 -07:00
|
|
|
- name: Create ninja archive
|
2019-10-30 19:52:32 -07:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir artifact
|
2020-01-17 23:50:10 +01:00
|
|
|
7z a artifact/ninja-win.zip ./build/Release/ninja.exe
|
2019-11-14 22:25:18 -08:00
|
|
|
|
2019-10-30 19:52:32 -07:00
|
|
|
# Upload ninja binary archive as an artifact
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: ninja-binary-archives
|
|
|
|
path: artifact
|
2019-11-14 22:25:18 -08:00
|
|
|
|
2019-10-30 22:30:12 -07:00
|
|
|
- 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 }}
|
2020-01-17 23:50:10 +01:00
|
|
|
asset_path: ./artifact/ninja-win.zip
|
|
|
|
asset_name: ninja-win.zip
|
2019-10-30 22:30:12 -07:00
|
|
|
asset_content_type: application/zip
|