@@ -2,77 +2,176 @@ name: CI
22
33on :
44 push :
5+ paths-ignore :
6+ - ' **.md'
7+ - ' **.rst'
58 pull_request :
9+ paths-ignore :
10+ - ' **.md'
11+ - ' **.rst'
612 repository_dispatch :
713 types : [run_build, run_release]
814 workflow_dispatch : {}
15+ env :
16+ HOMEBREW_NO_ANALYTICS : 1
17+ HOMEBREW_NO_AUTO_UPDATE : 1
18+ HOMEBREW_NO_INSTALL_UPGRADE : 1
19+ HOMEBREW_NO_INSTALL_CLEANUP : 1
20+ DEBIAN_FRONTEND : noninteractive
21+ TZ : Japan
922
1023jobs :
1124 build :
12- runs-on : ${{ matrix.os[0] }}
1325 strategy :
1426 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- ]
27+ os :
28+ - runs-on : macos-latest
29+ architecture : arm64
30+ shell : bash
31+ container : null
32+ container-options : " "
33+ macos-package-manager : brew
34+ - runs-on : macos-13
35+ architecture : x86_64
36+ shell : bash
37+ container : null
38+ container-options : " "
39+ macos-package-manager : brew
40+ - runs-on : macos-latest
41+ architecture : arm64
42+ shell : bash
43+ container : null
44+ container-options : " "
45+ macos-package-manager : port
46+ - runs-on : ubuntu-latest
47+ architecture : x86_64
48+ shell : bash
49+ container : " ubuntu:20.04"
50+ container-options : " --user 0"
51+ macos-package-manager : null
52+ - runs-on : ubuntu-24.04-arm
53+ architecture : arm64
54+ shell : bash
55+ container : " ubuntu:20.04"
56+ container-options : " --user 0"
57+ macos-package-manager : null
58+ - runs-on : windows-latest
59+ architecture : x86_64
60+ shell : msys2
61+ container : null
62+ container-options : " "
63+ macos-package-manager : null
2164 fail-fast : false
65+ runs-on : ${{ matrix.os.runs-on }}
2266 defaults :
2367 run :
24- shell : ${{ matrix.os[2] }} {0}
68+ shell : ${{ matrix.os.shell }} {0}
69+ container :
70+ image : ${{ matrix.os.container }}
71+ options : ${{ matrix.os.container-options }}
72+ timeout-minutes : 240
2573
2674 steps :
27- - uses : actions/checkout@v4
75+ - name : Checkout repository
76+ uses : actions/checkout@v4
2877
2978 - name : Install Ubuntu packages
30- if : matrix.os[0] == 'ubuntu-latest'
79+ if : startsWith( matrix.os.runs-on, 'ubuntu')
3180 run : |
32- sudo apt-get update
33- sudo apt-get -y install texinfo bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev
81+ apt-get -y update
82+ 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
3483
35- - name : Install macOS packages
36- if : startsWith(matrix.os[0] , 'macos')
84+ - name : Install macOS packages (brew)
85+ if : startsWith(matrix.os.runs-on , 'macos') && matrix.os.macos-package-manager == 'brew'
3786 run : |
3887 brew update
39- brew install texinfo bison flex gnu-sed gsl gmp mpfr libmpc
88+ brew install texinfo bison flex gnu-sed autoconf automake libtool gsl gmp mpfr libmpc md5sha1sum wget curl
89+
90+ - name : Install macOS packages (port)
91+ if : startsWith(matrix.os.runs-on, 'macos') && matrix.os.macos-package-manager == 'port'
92+ run : |
93+ curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci
94+ . ./macports-ci install --remove-brew --version=2.11.5 --sync=rsync
95+ sudo port install gsl gmp mpfr libmpc libiconv bison flex gsed texinfo autoconf automake libtool md5sha1sum wget curl
4096
4197 - name : Install MSYS2 packages
42- if : matrix.os[0] == 'windows-latest'
98+ if : startsWith( matrix.os.runs-on, 'windows')
4399 uses : msys2/setup-msys2@v2
44100 with :
45101 msystem : MINGW32
46102 install : |
47- base-devel git make texinfo flex bison patch mpc-devel tar
103+ base-devel git make texinfo flex bison patch binutils mpc-devel tar wget curl
104+ autotools gettext gettext-devel
48105 mingw-w64-i686-readline mingw-w64-i686-gcc mingw-w64-i686-cmake
49106 mingw-w64-i686-make mingw-w64-i686-libogg
50107 update : true
51108
52109 - name : Runs all the stages in the shell
110+ run : |
111+ . ./config/ci-env.sh
112+ if test -f ./build-all.sh; then ./build-all.sh; fi
113+ if test -f ./toolchain.sh; then ./toolchain.sh; fi
114+
115+ - name : Print version of executables (ps2toolchain-iop)
116+ if : github.event.repository.name == 'ps2toolchain-iop'
53117 run : |
54118 export PS2DEV=$PWD/ps2dev
55- export PATH="$(brew --prefix gnu-sed)/libexec/gnubin:$PATH" # This is just needed for MacOS
56- export PATH=$PATH:$PS2DEV/ee/bin
57- ./toolchain.sh
119+ export PATH=$PATH:$PS2DEV/iop/bin
120+ mipsel-none-elf-as --version
121+ mipsel-none-elf-ld --version
122+ mipsel-none-elf-gcc --version
58123
59- - name : Print version of executables
124+ - name : Print version of executables (ps2toolchain-ee)
125+ if : github.event.repository.name == 'ps2toolchain-ee'
60126 run : |
61127 export PS2DEV=$PWD/ps2dev
62128 export PATH=$PATH:$PS2DEV/ee/bin
63129 mips64r5900el-ps2-elf-as --version
64130 mips64r5900el-ps2-elf-ld --version
65131 mips64r5900el-ps2-elf-gcc --version
66132
133+ - name : Print version of executables (ps2toolchain-dvp)
134+ if : github.event.repository.name == 'ps2toolchain-dvp'
135+ run : |
136+ export PS2DEV=$PWD/ps2dev
137+ export PATH=$PATH:$PS2DEV/dvp/bin
138+ dvp-as --version
139+
67140 - name : Get short SHA
68141 id : slug
69- run : echo "sha8=${MSYSTEM}-sha[$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
142+ run : printf '%s\n' "sha8=$(printf '%s\n' ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
70143
71- - name : Prepare ps2dev folder
144+ - name : Compress ps2dev folder
72145 run : |
73- tar -zcvf ps2dev-${{matrix.os[0]}}.tar.gz ps2dev
146+ tar -zcvf ps2dev-${{ matrix.os.runs-on }}.tar.gz ps2dev
147+
148+ - name : Upload artifact
149+ uses : actions/upload-artifact@v4
150+ with :
151+ name : ${{ github.event.repository.name }}-${{ matrix.os.runs-on }}-ps2dev-${{ matrix.os.architecture }}-${{ matrix.os.macos-package-manager }}-${{ steps.slug.outputs.sha8 }}
152+ path : ps2dev-${{ matrix.os.runs-on }}.tar.gz
153+
154+ - name : Extract tag name
155+ if : startsWith(github.ref, 'refs/tags/')
156+ id : tag
157+ run : printf 'VERSION=%s\n' "${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
158+
159+ - name : Create pre-release
160+ if : (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && github.event.repository.name == 'ps2dev' && matrix.os.macos-package-manager != 'port'
161+ uses : softprops/action-gh-release@v2
162+ with :
163+ files : ps2dev-${{ matrix.os.runs-on }}.tar.gz
164+ prerelease : true
165+ name : " Development build"
166+ tag_name : latest
167+ env :
168+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
74169
75- - uses : actions/upload-artifact@v4
170+ - name : Release
171+ if : startsWith(github.ref, 'refs/tags/') && github.event.repository.name == 'ps2dev' && matrix.os.macos-package-manager != 'port'
172+ uses : softprops/action-gh-release@v2
76173 with :
77- name : ps2dev-${{matrix.os[0]}}-ps2dev-${{matrix.os[1]}}-${{ steps.slug.outputs.sha8 }}
78- path : ps2dev-${{matrix.os[0]}}.tar.gz
174+ files : ps2dev-${{ matrix.os.runs-on }}.tar.gz
175+ tag_name : ${{ steps.tag.outputs.VERSION }}
176+ env :
177+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments