Abstract platform-specific workflows into separate files

This commit is contained in:
sagudev 2023-03-28 14:22:18 +02:00
parent 55587bb92d
commit 1a84fcc9e1
5 changed files with 405 additions and 265 deletions

62
.github/workflows/windows.yml vendored Normal file
View file

@ -0,0 +1,62 @@
name: Windows workflow
on:
workflow_call:
inputs:
layout:
required: true
type: string
workflow_dispatch:
inputs:
layout:
required: true
type: choice
options: ["2013", "2020"]
push:
branches: ["try-windows"]
env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
LAYOUT: "${{ contains(inputs.layout, '2020') && 'layout-2020' || 'layout-2013' }}"
jobs:
build-win:
name: Build
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Copy to C drive
run: cp D:\a C:\ -Recurse
- name: Bootstrap
working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}"
run: |
python -m pip install --upgrade pip virtualenv
python mach fetch
- name: Release build
working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}"
run: python mach build --release --media-stack=dummy --with-${{ env.LAYOUT }}
- name: Unit tests
working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}"
run: python mach test-unit --release --with-${{ env.LAYOUT }}
- name: Smoketest
working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}"
run: python mach smoketest --angle
build_result:
name: homu build finished
runs-on: ubuntu-latest
if: always()
# needs all build to detect cancellation
needs:
- "build-win"
steps:
- name: Mark the job as successful
run: exit 0
if: ${{ !contains(join(needs.*.result, ','), 'failure') && !contains(join(needs.*.result, ','), 'cancelled') }}
- name: Mark the job as unsuccessful
run: exit 1
if: contains(join(needs.*.result, ','), 'failure') || contains(join(needs.*.result, ','), 'cancelled')