Game loop cleanup (#246) #332
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Trillek Engine CI | |
on: | |
pull_request: | |
push: | |
tags: [v*] | |
branches: | |
- master | |
# Add concurrency group to cancel in-progress runs | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
[ | |
windows-latest, | |
windows-2019, | |
ubuntu-latest, | |
ubuntu-20.04, | |
macOS-latest, | |
] | |
arch: [x86, x64] | |
include: | |
- os: windows-latest | |
vcpkgTripletOs: windows | |
- os: windows-2019 | |
vcpkgTripletOs: windows | |
- os: ubuntu-latest | |
vcpkgTripletOs: linux | |
- os: ubuntu-20.04 | |
vcpkgTripletOs: linux | |
- os: macOS-latest | |
vcpkgTripletOs: osx | |
exclude: | |
- os: ubuntu-latest | |
arch: x86 | |
- os: ubuntu-20.04 | |
arch: x86 | |
- os: macOS-latest | |
arch: x86 | |
env: | |
buildDir: "${{ github.workspace }}/build" | |
BUILD_PRESET: release | |
CONFIG_PRESET: ninja-multi-vcpkg-ci | |
VCPKG_COMMIT_ID: 10b7a178346f3f0abef60cecd5130e295afd8da4 | |
VCPKG_DEFAULT_TRIPLET: ${{ matrix.arch }}-${{ matrix.vcpkgTripletOs }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: lukka/get-cmake@latest | |
- name: Install os deps (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install libgl1-mesa-dev xorg-dev libglu1-mesa-dev libxinerama-dev libxcursor-dev p7zip-full -y | |
- name: Restore artifacts, or run vcpkg, build and cache artifacts | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }} | |
- name: Configure cmake and build | |
uses: lukka/run-cmake@v10 | |
with: | |
configurePreset: ${{ env.CONFIG_PRESET }} | |
buildPreset: ${{ env.CONFIG_PRESET }}-${{ env.BUILD_PRESET }} | |
testPreset: ${{ env.CONFIG_PRESET }}-${{ env.BUILD_PRESET }} | |
- name: Upload the build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "trillek-${{ matrix.os }}" | |
path: | | |
assets/ | |
${{ env.CLIENT_BUILD_DIR }}/trillek-client | |
${{ env.CLIENT_BUILD_DIR }}/trillek-client.exe | |
${{ env.CLIENT_BUILD_DIR }}/*.dll | |
${{ env.SERVER_BUILD_DIR }}/trillek-serverd | |
${{ env.SERVER_BUILD_DIR }}/trillek-server.exe | |
if-no-files-found: ignore | |
env: | |
CLIENT_BUILD_DIR: ${{ github.workspace }}/builds/${{ env.CONFIG_PRESET }}/client/Release | |
SERVER_BUILD_DIR: ${{ github.workspace }}/builds/${{ env.CONFIG_PRESET }}/server/Release | |
coverage: | |
runs-on: windows-latest | |
env: | |
buildDir: "${{ github.workspace }}/build" | |
BUILD_PRESET: debug | |
CONFIG_PRESET: ninja-multi-vcpkg-ci | |
VCPKG_COMMIT_ID: 10b7a178346f3f0abef60cecd5130e295afd8da4 | |
VCPKG_DEFAULT_TRIPLET: x64-windows | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: lukka/get-cmake@latest | |
- name: Restore artifacts, or run vcpkg, build and cache artifacts | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }} | |
- name: Configure cmake and build | |
uses: lukka/run-cmake@v10 | |
with: | |
configurePreset: ${{ env.CONFIG_PRESET }} | |
buildPreset: ${{ env.CONFIG_PRESET }}-${{ env.BUILD_PRESET }} | |
- name: Setup OpenCppCoverage and add to PATH | |
id: setup_opencppcoverage | |
run: | | |
choco install OpenCppCoverage -y | |
echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH | |
- name: Generate Report | |
id: generate_test_report | |
shell: cmd | |
run: OpenCppCoverage.exe --quiet --config_file opencppcovconfig.txt --export_type cobertura:coverage.xml -- ctest.exe --preset ${{ env.CONFIG_PRESET }}-${{ env.BUILD_PRESET }} | |
- name: Upload Report to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
files: ./coverage.xml | |
fail_ci_if_error: true | |
functionalities: fix | |
token: ${{ secrets.CODECOV_TOKEN }} | |
prepublish: | |
runs-on: ubuntu-latest | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/v') | |
name: Create Release | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: "${{ github.ref }}" | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
publish: | |
runs-on: ubuntu-latest | |
needs: prepublish | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
[ | |
windows-latest, | |
windows-2016, | |
ubuntu-latest, | |
ubuntu-20.04, | |
macOS-latest, | |
] | |
arch: [x64] | |
if: startsWith(github.ref, 'refs/tags/v') | |
name: Upload Release Asset(s) | |
steps: | |
- name: Download a single artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: "trillek-${{ matrix.os }}" | |
- name: Package release | |
run: | | |
zip --junk-paths -r -u trillek-${{ matrix.os }}.zip build/client | |
zip --junk-paths -r -u trillek-${{ matrix.os }}.zip build/server | |
zip -r -u trillek-${{ matrix.os }}.zip assets/ | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.prepublish.outputs.upload_url }} | |
asset_path: "./trillek-${{ matrix.os }}.zip" | |
asset_name: "trillek-${{ matrix.os }}.zip" | |
asset_content_type: application/zip |