Skip to content

Commit

Permalink
add ci badge to README
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Ji committed Nov 17, 2024
1 parent 363c0c4 commit c873f44
Show file tree
Hide file tree
Showing 7 changed files with 260 additions and 195 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/linux_cross.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Cross Build (linux)

on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
# Cancels pending runs when a PR gets updated.
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
cancel-in-progress: true

jobs:
build-cross-linux:
strategy:
fail-fast: false
matrix:
host: [macos-latest, windows-latest]
target: [x86_64-linux-gnu, aarch64-linux-gnu]
runs-on: ${{matrix.host}}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Read .zig-version
id: zigversion
uses: juliangruber/read-file-action@v1
with:
path: ./.zigversion
- name: Install Zig
uses: mlugg/setup-zig@v1
with:
version: ${{ steps.zigversion.outputs.content }}
- name: Build examples
run: zig build -Dtarget=${{matrix.target}} -Dskip=particle_life examples

43 changes: 43 additions & 0 deletions .github/workflows/linux_native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Native Build (linux)

on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
# Cancels pending runs when a PR gets updated.
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
cancel-in-progress: true

jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Read .zig-version
id: zigversion
uses: juliangruber/read-file-action@v1
with:
path: ./.zigversion
- name: Install Zig
uses: mlugg/setup-zig@v1
with:
version: ${{ steps.zigversion.outputs.content }}
- name: Install sdl2
run: |
sudo apt-get update
sudo apt-get install libsdl2-dev
- name: SDL version
run: sdl2-config --version
- name: Check format
continue-on-error: true
run: zig fmt --check .
- name: Build and run tests
run: zig build test
- name: Build examples
run: zig build -Dskip=particle_life,intersection_2d examples
36 changes: 36 additions & 0 deletions .github/workflows/macos_native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Native Build (macos)

on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
# Cancels pending runs when a PR gets updated.
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
cancel-in-progress: true

jobs:
# build-macos:
# runs-on: macos-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# - name: Read .zig-version
# id: zigversion
# uses: juliangruber/read-file-action@v1
# with:
# path: ./.zigversion
# - name: Install Zig
# uses: mlugg/setup-zig@v1
# with:
# version: ${{ steps.zigversion.outputs.content }}
# - name: Install sdl2
# run: brew install sdl2
# - name: Build and run tests
# run: zig build test
# - name: Build examples
# run: zig build examples
195 changes: 0 additions & 195 deletions .github/workflows/main.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/windows_cross.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Cross Build (windows)

on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
# Cancels pending runs when a PR gets updated.
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
cancel-in-progress: true

jobs:
build-cross-windows:
strategy:
fail-fast: false
matrix:
host: [ubuntu-latest, macos-latest]
runs-on: ${{matrix.host}}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Read .zig-version
id: zigversion
uses: juliangruber/read-file-action@v1
with:
path: ./.zigversion
- name: Install Zig
uses: mlugg/setup-zig@v1
with:
version: ${{ steps.zigversion.outputs.content }}
- name: Download SDL2 (MinGW)
uses: carlosperate/[email protected]
with:
file-url: https://www.libsdl.org/release/SDL2-devel-2.30.9-mingw.tar.gz
file-name: SDL2.tar.gz
location: .
- name: Extract SDL2
uses: brunoborges/justextract@v1
with:
file: SDL2.tar.gz
- name: Create SDK file
uses: DamianReeves/[email protected]
with:
path: .build_config/sdl.json
contents: |
{
"x86_64-windows-gnu": {
"include": "SDL2-2.30.9/x86_64-w64-mingw32/include",
"libs": "SDL2-2.30.9/x86_64-w64-mingw32/lib",
"bin": "SDL2-2.30.9/x86_64-w64-mingw32/bin"
}
}
write-mode: overwrite
- name: Build examples
run: zig build -Dtarget=x86_64-windows-gnu -Dskip=particle_life examples
Loading

0 comments on commit c873f44

Please sign in to comment.