CI improvements 20250918 #103
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
- '**.rst' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '**.rst' | |
repository_dispatch: | |
types: [run_build, run_release] | |
workflow_dispatch: {} | |
env: | |
HOMEBREW_NO_ANALYTICS: 1 | |
HOMEBREW_NO_AUTO_UPDATE: 1 | |
HOMEBREW_NO_INSTALL_UPGRADE: 1 | |
HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
DEBIAN_FRONTEND: noninteractive | |
TZ: Japan | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: | |
- runs-on: macos-latest | |
architecture: arm64 | |
shell: bash | |
container: null | |
container-options: " " | |
macos-package-manager: brew | |
- runs-on: macos-13 | |
architecture: x86_64 | |
shell: bash | |
container: null | |
container-options: " " | |
macos-package-manager: brew | |
- runs-on: macos-latest | |
architecture: arm64 | |
shell: bash | |
container: null | |
container-options: " " | |
macos-package-manager: port | |
- runs-on: ubuntu-latest | |
architecture: x86_64 | |
shell: bash | |
container: "ubuntu:20.04" | |
container-options: "--user 0" | |
macos-package-manager: null | |
- runs-on: ubuntu-24.04-arm | |
architecture: arm64 | |
shell: bash | |
container: "ubuntu:20.04" | |
container-options: "--user 0" | |
macos-package-manager: null | |
- runs-on: windows-latest | |
architecture: x86_64 | |
shell: msys2 | |
container: null | |
container-options: " " | |
macos-package-manager: null | |
fail-fast: false | |
runs-on: ${{ matrix.os.runs-on }} | |
defaults: | |
run: | |
shell: ${{ matrix.os.shell }} {0} | |
container: | |
image: ${{ matrix.os.container }} | |
options: ${{ matrix.os.container-options }} | |
timeout-minutes: 240 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Ubuntu packages | |
if: startsWith(matrix.os.runs-on, 'ubuntu') | |
run: | | |
apt-get -y update | |
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 | |
- name: Install macOS packages (brew) | |
if: startsWith(matrix.os.runs-on, 'macos') && matrix.os.macos-package-manager == 'brew' | |
run: | | |
brew update | |
brew install texinfo bison flex gnu-sed autoconf automake libtool gsl gmp mpfr libmpc md5sha1sum wget curl | |
- name: Install macOS packages (port) | |
if: startsWith(matrix.os.runs-on, 'macos') && matrix.os.macos-package-manager == 'port' | |
run: | | |
curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci | |
. ./macports-ci install --remove-brew --version=2.11.5 --sync=rsync | |
sudo port install gsl gmp mpfr libmpc libiconv bison flex gsed texinfo autoconf automake libtool md5sha1sum wget curl | |
- name: Install MSYS2 packages | |
if: startsWith(matrix.os.runs-on, 'windows') | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: MINGW32 | |
install: | | |
base-devel git make texinfo flex bison patch binutils mpc-devel tar wget curl | |
autotools gettext gettext-devel | |
mingw-w64-i686-readline mingw-w64-i686-gcc mingw-w64-i686-cmake | |
mingw-w64-i686-make mingw-w64-i686-libogg | |
update: true | |
- name: Runs all the stages in the shell | |
run: | | |
. ./config/ci-env.sh | |
if test -f ./build-all.sh; then ./build-all.sh; fi | |
if test -f ./toolchain.sh; then ./toolchain.sh; fi | |
- name: Print version of executables (ps2toolchain-iop) | |
if: github.event.repository.name == 'ps2toolchain-iop' | |
run: | | |
export PS2DEV=$PWD/ps2dev | |
export PATH=$PATH:$PS2DEV/iop/bin | |
mipsel-none-elf-as --version | |
mipsel-none-elf-ld --version | |
mipsel-none-elf-gcc --version | |
- name: Print version of executables (ps2toolchain-ee) | |
if: github.event.repository.name == 'ps2toolchain-ee' | |
run: | | |
export PS2DEV=$PWD/ps2dev | |
export PATH=$PATH:$PS2DEV/ee/bin | |
mips64r5900el-ps2-elf-as --version | |
mips64r5900el-ps2-elf-ld --version | |
mips64r5900el-ps2-elf-gcc --version | |
- name: Print version of executables (ps2toolchain-dvp) | |
if: github.event.repository.name == 'ps2toolchain-dvp' | |
run: | | |
export PS2DEV=$PWD/ps2dev | |
export PATH=$PATH:$PS2DEV/dvp/bin | |
dvp-as --version | |
- name: Get short SHA | |
id: slug | |
run: printf '%s\n' "sha8=$(printf '%s\n' ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT | |
- name: Compress ps2dev folder | |
run: | | |
tar -zcvf ps2dev-${{ matrix.os.runs-on }}.tar.gz ps2dev | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.event.repository.name }}-${{ matrix.os.runs-on }}-ps2dev-${{ matrix.os.architecture }}-${{ matrix.os.macos-package-manager }}-${{ steps.slug.outputs.sha8 }} | |
path: ps2dev-${{ matrix.os.runs-on }}.tar.gz | |
- name: Extract tag name | |
if: startsWith(github.ref, 'refs/tags/') | |
id: tag | |
run: printf 'VERSION=%s\n' "${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | |
- name: Create pre-release | |
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && github.event.repository.name == 'ps2dev' && matrix.os.macos-package-manager != 'port' | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: ps2dev-${{ matrix.os.runs-on }}.tar.gz | |
prerelease: true | |
name: "Development build" | |
tag_name: latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/') && github.event.repository.name == 'ps2dev' && matrix.os.macos-package-manager != 'port' | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: ps2dev-${{ matrix.os.runs-on }}.tar.gz | |
tag_name: ${{ steps.tag.outputs.VERSION }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |