Skip to content

Commit

Permalink
Add CI workflows for Linux, MacOS and Windows.
Browse files Browse the repository at this point in the history
This is equivalent to the CI workflows added to the yquake2 main
repository. The workflows are triggered on commit, for new pull
requests and when the pull request branch is updated. The CI is
mostly for providing users with up to date test builds.
  • Loading branch information
Yamagi committed Aug 12, 2024
1 parent 69faeb6 commit 68f407f
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Testbuild for Linux
run-name: testbuild_linux
on:
push:
branches:
- 'master'
pull_request:
types:
- edited
- opened
- synchronize
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
build_ubuntu_x64_64:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- env: ubuntu
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Build
run: |
# Public runners come with 2 CPUs.
make -j2
- name: Create testbuild package
run: |
# Create release directory tree
mkdir -p publish/quake2-xatrix-linux-${{github.sha}}/misc/docs
# Copy release assets
cp -r release/* publish/quake2-xatrix-linux-${{github.sha}}/
# Copy misc assets
cp -r stuff/mapfixes publish/quake2-xatrix-linux-${{github.sha}}/misc
cp LICENSE publish/quake2-xatrix-linux-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-xatrix-linux-${{github.sha}}/misc/docs/README.txt
- name: Upload testbuild package
uses: actions/upload-artifact@v4
with:
name: quake2-xatrix-linux-${{github.sha}}
path: publish/
if-no-files-found: error
51 changes: 51 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Testbuild for MacOS
run-name: testbuild_macos
on:
push:
branches:
- 'master'
pull_request:
types:
- edited
- opened
- synchronize
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
build_macos_aarch64:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- env: macos
steps:
- name: Install build dependencies
run: |
brew update
brew install make
brew upgrade
- name: Check out repository code
uses: actions/checkout@v4
- name: Build
run: |
# Public runners come with 3 CPUs.
gmake -j3
- name: Create testbuild package
run: |
# Create release directory tree
mkdir -p publish/quake2-xatrix-macos-${{github.sha}}/misc/docs
# Copy release assets
cp -r release/* publish/quake2-xatrix-macos-${{github.sha}}/
# Copy misc assets
cp -r stuff/mapfixes publish/quake2-xatrix-macos-${{github.sha}}/misc
cp LICENSE publish/quake2-xatrix-macos-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-xatrix-macos-${{github.sha}}/misc/docs/README.txt
- name: Upload testbuild package
uses: actions/upload-artifact@v4
with:
name: quake2-xatrix-macos-${{github.sha}}
path: publish/
if-no-files-found: error
57 changes: 57 additions & 0 deletions .github/workflows/win32.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Testbuild for Win32
run-name: testbuild_win32
on:
push:
branches:
- 'master'
pull_request:
types:
- edited
- opened
- synchronize
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
build_mingw_x86_32:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { sys: mingw32, env: i686 }
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
install: >-
git
make
mingw-w64-${{matrix.env}}-gcc
mingw-w64-${{matrix.env}}-make
- name: Check out repository code
uses: actions/checkout@v4
- name: Build
shell: msys2 {0}
run: |
# Public runners come with 2 CPUs.
make -j2
- name: Create testbuild package
shell: msys2 {0}
run: |
# Create release directory tree
mkdir -p publish/quake2-xatrix-win32-${{github.sha}}/misc/docs
# Copy release assets
cp -r release/* publish/quake2-xatrix-win32-${{github.sha}}/
# Copy misc assets
cp -r stuff/mapfixes publish/quake2-xatrix-win32-${{github.sha}}/misc
cp LICENSE publish/quake2-xatrix-win32-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-xatrix-win32-${{github.sha}}/misc/docs/README.txt
- name: Upload testbuild package
uses: actions/upload-artifact@v4
with:
name: quake2-xatrix-win32-${{github.sha}}
path: publish/
if-no-files-found: error

0 comments on commit 68f407f

Please sign in to comment.