Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify GitHub actions #521

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "Hello World"
description: "Greet someone"
inputs:
architecture:
description: "Build Architecture"
default: x86
docs:
description: Build documentation?
default: OFF

outputs:
random-number:
description: "Random number"
value: ${{ steps.random-number-generator.outputs.random-number }}

runs:
using: "composite"

steps:
- name: Setup Problem Matcher
uses: ammaraskar/msvc-problem-matcher@master

- name: Setup MSVC Console
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ inputs.architecture }}

- name: Install documentation prerequisites
if: ${{ inputs.docs == 'ON' }}
shell: pwsh
run: |
choco install --no-progress miktex
choco install --no-progress doxygen.install
choco install --no-progress libreoffice-fresh
Add-Content $env:GITHUB_PATH "C:\Program Files\MiKTeX\miktex\bin\x64\"

- name: Create directories
shell: cmd
run: |
mkdir out\build
mkdir out\install

- name: Cache irrKlang package
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/Extern/irrKlang/${{ inputs.architecture }}
key: irrKlang-${{ inputs.architecture }}

- name: Cache DirectX SDK
id: cache
uses: actions/cache@v4
with:
path: "${{ github.workspace }}\\DXSDK"
key: dxsdk_jun10

- name: Download DirectX SDK
if: steps.cache.outputs.cache-hit != 'true'
shell: cmd
run: |
curl -L https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe -o DXSDK_Jun10.exe
7z x DXSDK_Jun10.exe DXSDK/Include
7z x DXSDK_Jun10.exe DXSDK/Lib
del DXSDK_Jun10.exe
dir /S /B DXSDK

- name: Configure
shell: cmd
run: cmake . --preset windows-${{ inputs.architecture }}-release
-DORBITER_MAKE_DOC=${{ inputs.docs }}
-DDXSDK_DIR:PATH="${{ github.workspace }}\\DXSDK"

- name: Build
shell: cmd
run: cmake --build --preset windows-${{ inputs.architecture }}-release --jobs 2
17 changes: 13 additions & 4 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@ jobs:
matrix:
architecture: [x64, x86]
os: [windows-2022]
uses: ./.github/workflows/reusable-build.yml
with:
os: ${{ matrix.os }}
architecture: ${{ matrix.architecture }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- run: dir /S /B
shell: cmd

- name: Build
uses: ./.github/actions/build
timeout-minutes: 60
with:
architecture: ${{ matrix.architecture }}