Fix CI for Linux and add CI for macOS (#1223)
Some checks failed
CI / build (push) Has been cancelled
CI / build-macos (push) Has been cancelled

This commit is contained in:
Rangi 2026-01-17 16:19:24 -05:00 committed by Rangi
parent e4a41d447b
commit 5539e3dfab
2 changed files with 60 additions and 21 deletions

8
.github/checkdiff.sh vendored Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
set -e
if ! git diff-index --quiet HEAD --; then
echo 'Uncommitted changes detected:'
git diff-index HEAD --
return 1
fi

View File

@ -5,25 +5,29 @@ on:
branches: [ master ]
pull_request:
env:
rgbds_version: v1.0.1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v6
- name: Checkout rgbds
uses: actions/checkout@master
uses: actions/checkout@v6
with:
path: rgbds
ref: v1.0.1
ref: ${{ env.rgbds_version }}
repository: gbdev/rgbds
- name: Install rgbds
working-directory: rgbds
run: |
sudo apt-get install -yq libpng-dev
sudo make install
sudo apt-get update
sudo apt-get install -yq bison libpng-dev pkg-config
sudo make -j$(nproc) install
- name: Remove rgbds
run: |
@ -33,39 +37,66 @@ jobs:
if: ${{ github.repository_owner == 'pret' }}
run: |
make DEBUG=1 -j$(nproc) compare
if ! git diff-index --quiet HEAD --; then
echo 'Uncommitted changes detected:'
git diff-index HEAD --
return 1
fi
.github/checkdiff.sh
- name: Make
if: ${{ github.repository_owner != 'pret' }}
run: |
make -j$(nproc)
if ! git diff-index --quiet HEAD --; then
echo 'Uncommitted changes detected:'
git diff-index HEAD --
return 1
fi
.github/checkdiff.sh
- name: Checkout symbols
if: ${{ github.event_name == 'push' && github.repository_owner == 'pret' }}
uses: actions/checkout@master
if: ${{ github.repository_owner == 'pret' && github.event_name == 'push' }}
uses: actions/checkout@v6
with:
path: symbols
ref: symbols
- name: Move symbols
if: ${{ github.event_name == 'push' && github.repository_owner == 'pret' }}
if: ${{ github.repository_owner == 'pret' && github.event_name == 'push' }}
run: |
cp -v *.sym symbols/
cp -v *.map symbols/
cp -v *.sym *.map symbols/
- name: Update symbols
if: ${{ github.event_name == 'push' && github.repository_owner == 'pret' }}
if: ${{ github.repository_owner == 'pret' && github.event_name == 'push' }}
uses: EndBug/add-and-commit@v9
with:
cwd: "./symbols"
add: "*.sym *.map"
message: ${{ github.event.commits[0].message }}
build-macos:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Checkout rgbds
uses: actions/checkout@v6
with:
path: rgbds
ref: ${{ env.rgbds_version }}
repository: gbdev/rgbds
- name: Install rgbds
working-directory: rgbds
run: |
brew install bison libpng pkg-config
export PATH="$(brew --prefix bison)/bin:$PATH"
sudo make -j$(sysctl -n hw.ncpu) install
- name: Remove rgbds
run: |
rm -rf rgbds
- name: Compare
if: ${{ github.repository_owner == 'pret' }}
run: |
make DEBUG=1 -j$(sysctl -n hw.ncpu) compare
.github/checkdiff.sh
- name: Make
if: ${{ github.repository_owner != 'pret' }}
run: |
make -j$(sysctl -n hw.ncpu)
.github/checkdiff.sh