Skip to content

Commit

Permalink
chore(ci): Switch Windows to GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
timniederhausen committed Mar 11, 2024
1 parent 426e22b commit 74ca4f2
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 62 deletions.
59 changes: 0 additions & 59 deletions .appveyor.yml

This file was deleted.

96 changes: 96 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Windows

on:
pull_request:
branches:
- master
- develop
- feature/**
push:
branches:
- master
- develop
- feature/**
workflow_dispatch:
release:
types: published

env:
NINJA_BASE_URL: https://github.com/ninja-build/ninja/releases/download/
GN_BASE_URL: https://github.com/timniederhausen/gn/releases/download/2021.03/

jobs:
windows:
strategy:
fail-fast: false
matrix:
include:
# 2019
- slug: windows-2019 debug
gen_args: 'is_official_build = false'
os: windows-2019
ninja_release_name: v1.7.2/ninja-win.zip
gn_release_name: gn-win-amd64.zip

- slug: windows-2019 official
gen_args: 'is_official_build = true'
os: windows-2019
ninja_release_name: v1.7.2/ninja-win.zip
gn_release_name: gn-win-amd64.zip

# 2022
- slug: windows-2022 debug
gen_args: 'is_official_build = false'
os: windows-2022
ninja_release_name: v1.7.2/ninja-win.zip
gn_release_name: gn-win-amd64.zip

- slug: windows-2022 official
gen_args: 'is_official_build = true'
os: windows-2022
ninja_release_name: v1.7.2/ninja-win.zip
gn_release_name: gn-win-amd64.zip

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
# we need all everything for `git describe` to work correctly
fetch-depth: 0

- name: Install recent Ninja
run: |
Invoke-WebRequest -OutFile ninja.zip -Uri "${{ env.NINJA_BASE_URL }}${{ matrix.ninja_release_name }}"
python -c 'import sys,zipfile;zipfile.ZipFile(sys.argv[1]).extractall()' ninja.zip
- name: Install GN
run: |
Invoke-WebRequest -OutFile gn.zip -Uri "${{ env.GN_BASE_URL }}${{ matrix.gn_release_name }}"
python -c 'import sys,zipfile;zipfile.ZipFile(sys.argv[1]).extractall()' gn.zip
# Run gn_helpers unittests first - this should fail if we have an unsupported Python version
# Only support Python3+ for now, otherwise we have to ship the mocking lib
- name: Test gn_helpers
run: |
python3 gn_helpers_unittest.py
# Setup test project for our //build
- name: Setup test project
run: |
git clone --branch=testsrc --depth=1 https://github.com/timniederhausen/gn-build.git testsrc
mkdir testsrc/build
mv config testsrc/build/
mv toolchain testsrc/build/
# Try to generate ninja files with different python versions
- name: gen with python3
run: |
.\gn.exe gen out --args='${{ matrix.gen_args }}' --root=testsrc
# Try to build the test project
- name: Build
run: |
cat out/args.gn
.\ninja.exe -C out
cd out && ./hello
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ The toolchains have been tested on the following platforms:
* Linux (GCC 6, Clang 3.8)
* OS X (Xcode 7.3.1)

[![Build Status](https://travis-ci.org/timniederhausen/gn-build.svg?branch=master)](https://travis-ci.org/timniederhausen/gn-build)
[![Build status](https://ci.appveyor.com/api/projects/status/jpot0c7wp6e78lkk/branch/master?svg=true)](https://ci.appveyor.com/project/timniederhausen/gn-build)

The [testsrc](https://github.com/timniederhausen/gn-build/tree/testsrc)
branch contains the test/example project used by the CI tests.

Expand Down

0 comments on commit 74ca4f2

Please sign in to comment.