Skip to content

Commit 4cf1b92

Browse files
authored
Merge pull request #111 from uyjulian/ci_improvements_20250918
CI improvements 20250918
2 parents 9928e14 + 4928e71 commit 4cf1b92

File tree

5 files changed

+299
-64
lines changed

5 files changed

+299
-64
lines changed

.github/workflows/compilation.yml

100644100755
Lines changed: 117 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,70 +2,157 @@ name: CI
22

33
on:
44
push:
5+
paths-ignore:
6+
- '**.md'
7+
- '**.rst'
58
pull_request:
9+
paths-ignore:
10+
- '**.md'
11+
- '**.rst'
612
repository_dispatch:
7-
types: [run_build]
13+
types:
14+
- run_build
15+
- run_release
816
workflow_dispatch: {}
17+
env:
18+
HOMEBREW_NO_ANALYTICS: 1
19+
HOMEBREW_NO_AUTO_UPDATE: 1
20+
HOMEBREW_NO_INSTALL_UPGRADE: 1
21+
HOMEBREW_NO_INSTALL_CLEANUP: 1
22+
DEBIAN_FRONTEND: noninteractive
23+
TZ: Japan
924

1025
jobs:
1126
build:
12-
runs-on: ${{ matrix.os[0] }}
1327
strategy:
1428
matrix:
15-
os: [
16-
[macos-latest, arm64, bash],
17-
[macos-13, x86_64, bash],
18-
[ubuntu-latest, x86_64, bash],
19-
[windows-latest, x86_64, msys2]
20-
]
29+
os:
30+
- runs-on: macos-latest
31+
architecture: arm64
32+
shell: bash
33+
container: null
34+
container-options: " "
35+
macos-package-manager: brew
36+
- runs-on: macos-15-intel
37+
architecture: x86_64
38+
shell: bash
39+
container: null
40+
container-options: " "
41+
macos-package-manager: brew
42+
- runs-on: macos-latest
43+
architecture: arm64
44+
shell: bash
45+
container: null
46+
container-options: " "
47+
macos-package-manager: port
48+
- runs-on: ubuntu-latest
49+
architecture: x86_64
50+
shell: bash
51+
container: "ubuntu:20.04"
52+
container-options: "--user 0"
53+
macos-package-manager: null
54+
- runs-on: ubuntu-24.04-arm
55+
architecture: arm64
56+
shell: bash
57+
container: "ubuntu:20.04"
58+
container-options: "--user 0"
59+
macos-package-manager: null
60+
- runs-on: windows-latest
61+
architecture: x86_64
62+
shell: msys2
63+
container: null
64+
container-options: " "
65+
macos-package-manager: null
2166
fail-fast: false
67+
runs-on: ${{ matrix.os.runs-on }}
2268
defaults:
2369
run:
24-
shell: ${{ matrix.os[2] }} {0}
70+
shell: ${{ matrix.os.shell }} {0}
71+
container:
72+
image: ${{ matrix.os.container }}
73+
options: ${{ matrix.os.container-options }}
74+
timeout-minutes: 240
2575

2676
steps:
27-
- uses: actions/checkout@v4
77+
- name: Checkout repository
78+
uses: actions/checkout@v4
2879

2980
- name: Install Ubuntu packages
30-
if: matrix.os[0] == 'ubuntu-latest'
81+
if: startsWith(matrix.os.runs-on, 'ubuntu')
3182
run: |
32-
sudo apt-get update
33-
sudo apt-get -y install texinfo bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev
83+
apt-get -y update
84+
apt-get -y -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' install texinfo bison flex gettext autopoint autoconf automake libgmp3-dev libmpfr-dev libmpc-dev cmake g++ gcc git libgsl-dev make patch zlib1g-dev wget curl
3485
35-
- name: Install macOS packages
36-
if: startsWith(matrix.os[0], 'macos')
86+
- name: Install macOS packages (brew)
87+
if: startsWith(matrix.os.runs-on, 'macos') && matrix.os.macos-package-manager == 'brew'
3788
run: |
3889
brew update
39-
brew install texinfo bison flex gnu-sed gsl gmp mpfr libmpc
90+
brew install texinfo bison flex gnu-sed autoconf automake libtool gsl gmp mpfr libmpc md5sha1sum wget curl
91+
92+
- name: Install macOS packages (port)
93+
if: startsWith(matrix.os.runs-on, 'macos') && matrix.os.macos-package-manager == 'port'
94+
run: |
95+
curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci
96+
. ./macports-ci install --remove-brew --version=2.11.5 --sync=rsync
97+
sudo port install gsl gmp mpfr libmpc libiconv bison flex gsed texinfo autoconf automake libtool md5sha1sum wget curl
4098
4199
- name: Install MSYS2 packages
42-
if: matrix.os[0] == 'windows-latest'
100+
if: startsWith(matrix.os.runs-on, 'windows')
43101
uses: msys2/setup-msys2@v2
44102
with:
45103
msystem: MINGW32
46104
install: |
47-
base-devel git make texinfo flex bison patch binutils mpc-devel tar
105+
base-devel git make texinfo flex bison patch binutils mpc-devel tar wget curl
106+
autotools gettext gettext-devel
48107
mingw-w64-i686-readline mingw-w64-i686-gcc mingw-w64-i686-cmake
49108
mingw-w64-i686-make mingw-w64-i686-libogg
50109
update: true
51110

52111
- name: Runs all the stages in the shell
53112
run: |
54-
export PS2DEV=$PWD/ps2dev
55-
export PS2SDK=$PS2DEV/ps2sdk
56-
export PATH="$(brew --prefix gnu-sed)/libexec/gnubin:$PATH" # This is just needed for MacOS
57-
export PATH=$PATH:$PS2DEV/bin:$PS2DEV/ee/bin:$PS2DEV/iop/bin:$PS2DEV/dvp/bin:$PS2SDK/bin
58-
./toolchain.sh
113+
. ./config/ci-env.sh
114+
if test -f ./build-all.sh; then ./build-all.sh; fi
115+
if test -f ./toolchain.sh; then ./toolchain.sh; fi
116+
117+
- name: Print version of executables
118+
run: |
119+
if test -f ./config/ci-print-version.sh; then ./config/ci-print-version.sh; fi
59120
60121
- name: Get short SHA
61122
id: slug
62-
run: echo "sha8=${MSYSTEM}-sha[$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
63-
64-
- name: Prepare ps2dev folder
123+
run: printf '%s\n' "sha8=$(printf '%s\n' ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
124+
125+
- name: Compress ps2dev folder
65126
run: |
66-
tar -zcvf ps2dev-${{matrix.os[0]}}.tar.gz ps2dev
127+
tar -zcvf ps2dev-${{ matrix.os.runs-on }}.tar.gz ps2dev
128+
129+
- name: Upload artifact
130+
uses: actions/upload-artifact@v4
131+
with:
132+
name: ${{ github.event.repository.name }}-${{ matrix.os.runs-on }}-ps2dev-${{ matrix.os.architecture }}-${{ matrix.os.macos-package-manager }}-${{ steps.slug.outputs.sha8 }}
133+
path: ps2dev-${{ matrix.os.runs-on }}.tar.gz
134+
135+
- name: Extract tag name
136+
if: startsWith(github.ref, 'refs/tags/')
137+
id: tag
138+
run: printf 'VERSION=%s\n' "${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
139+
140+
- name: Create pre-release
141+
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && github.event.repository.name == 'ps2dev' && matrix.os.macos-package-manager != 'port'
142+
uses: softprops/action-gh-release@v2
143+
with:
144+
files: ps2dev-${{ matrix.os.runs-on }}.tar.gz
145+
prerelease: true
146+
name: "Development build"
147+
tag_name: latest
148+
env:
149+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67150

68-
- uses: actions/upload-artifact@v4
151+
- name: Release
152+
if: startsWith(github.ref, 'refs/tags/') && github.event.repository.name == 'ps2dev' && matrix.os.macos-package-manager != 'port'
153+
uses: softprops/action-gh-release@v2
69154
with:
70-
name: ps2dev-${{matrix.os[0]}}-ps2dev-${{matrix.os[1]}}-${{ steps.slug.outputs.sha8 }}
71-
path: ps2dev-${{matrix.os[0]}}.tar.gz
155+
files: ps2dev-${{ matrix.os.runs-on }}.tar.gz
156+
tag_name: ${{ steps.tag.outputs.VERSION }}
157+
env:
158+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)