-
Notifications
You must be signed in to change notification settings - Fork 21
CI improvements 20250918 #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,106 +2,176 @@ 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: | ||
| runs-on: ${{ matrix.target.machine }} | ||
| strategy: | ||
| matrix: | ||
| target: | ||
| - machine: macos-latest | ||
| os: | ||
| - runs-on: macos-latest | ||
| architecture: arm64 | ||
| shell: bash | ||
| packageManager: brew | ||
| - machine: macos-13 | ||
| container: null | ||
| container-options: " " | ||
| macos-package-manager: brew | ||
| - runs-on: macos-13 | ||
| architecture: x86_64 | ||
| shell: bash | ||
| packageManager: brew | ||
| - machine: macos-latest | ||
| container: null | ||
| container-options: " " | ||
| macos-package-manager: brew | ||
| - runs-on: macos-latest | ||
| architecture: arm64 | ||
| shell: bash | ||
| packageManager: macport | ||
| - machine: ubuntu-latest | ||
| container: null | ||
| container-options: " " | ||
| macos-package-manager: port | ||
| - runs-on: ubuntu-latest | ||
| architecture: x86_64 | ||
| shell: bash | ||
| packageManager: default | ||
| - machine: ubuntu-22.04-arm | ||
| container: "ubuntu:20.04" | ||
| container-options: "--user 0" | ||
| macos-package-manager: null | ||
| - runs-on: ubuntu-24.04-arm | ||
| architecture: arm64 | ||
| shell: bash | ||
| packageManager: default | ||
| - machine: ubuntu-24.04-arm | ||
| architecture: arm64 | ||
| shell: bash | ||
| packageManager: default | ||
| - machine: windows-latest | ||
| container: "ubuntu:20.04" | ||
| container-options: "--user 0" | ||
| macos-package-manager: null | ||
| - runs-on: windows-latest | ||
| architecture: x86_64 | ||
| shell: msys2 | ||
| packageManager: default | ||
| container: null | ||
| container-options: " " | ||
| macos-package-manager: null | ||
| fail-fast: false | ||
| runs-on: ${{ matrix.os.runs-on }} | ||
| defaults: | ||
| run: | ||
| shell: ${{ matrix.target.shell }} {0} | ||
| shell: ${{ matrix.os.shell }} {0} | ||
| container: | ||
| image: ${{ matrix.os.container }} | ||
| options: ${{ matrix.os.container-options }} | ||
| timeout-minutes: 240 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are you setting
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is in case the build hangs (e.g. stuck at prompt or stuck in infinite retry loop) it will allow to notice earlier. Github default runners have a maximum timeout of 6 hours, so I reduced it to 4 hours. |
||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Ubuntu packages | ||
| if: startsWith(matrix.target.machine, 'ubuntu') | ||
| if: startsWith(matrix.os.runs-on, 'ubuntu') | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get -y install texinfo bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev | ||
| 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 with brew | ||
| if: startsWith(matrix.target.machine, 'macos') && matrix.target.packageManager == 'brew' | ||
| - 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 gsl gmp mpfr libmpc | ||
| brew install texinfo bison flex gnu-sed autoconf automake libtool gsl gmp mpfr libmpc md5sha1sum wget curl | ||
|
|
||
| - name: Install macOS packages with macport | ||
| if: startsWith(matrix.target.machine, 'macos') && matrix.target.packageManager == 'macport' | ||
| - 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 | ||
| source ./macports-ci install --remove-brew --version=2.11.5 --sync=rsync | ||
| sudo port install gmp mpfr libmpc libiconv bison flex texinfo | ||
| . ./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.target.machine, 'windows') | ||
| 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 | ||
| mingw-w64-i686-readline mingw-w64-i686-gcc | ||
| mingw-w64-i686-cmake mingw-w64-i686-make mingw-w64-i686-libogg | ||
| 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 | ||
| continue-on-error: false | ||
| 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/dvp/bin | ||
| ./toolchain.sh | ||
| 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 | ||
| - 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: | | ||
| echo "sha8=${MSYSTEM}-sha[$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT | ||
| run: printf '%s\n' "sha8=$(printf '%s\n' ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Prepare ps2dev folder | ||
| - name: Compress ps2dev folder | ||
| run: | | ||
| tar -zcvf ps2dev-${{matrix.target.machine}}.tar.gz ps2dev | ||
| 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 }} | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| - 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: | ||
| name: ps2dev-${{matrix.target.machine}}-ps2dev-${{matrix.target.architecture}}-${{matrix.target.packageManager}}-${{ steps.slug.outputs.sha8 }} | ||
| path: ps2dev-${{matrix.target.machine}}.tar.gz | ||
| files: ps2dev-${{ matrix.os.runs-on }}.tar.gz | ||
| tag_name: ${{ steps.tag.outputs.VERSION }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/bin/bash | ||
|
|
||
| export PS2DEV=$PWD/ps2dev | ||
| export PATH=$PATH:$PS2DEV/bin | ||
| export PATH=$PATH:$PS2DEV/dvp/bin |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| DEST_REPO=["ps2toolchain"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get why you use Docker inside of Ubuntu, and you actually use the OS version
20.04, which reduces compatibility, as the precompiled toolchain can't be used in modern versions.I could understand using Docker for those OS GHA doesn't offer as VM, like for instance
Fedora, but I don't get your current approachThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually increases compatibility, as stuff built on 20.04 also works on 22.04 and 24.04.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But on the other hand, we loose the visibility of checking if the toolchain works with "actual & more used" Ubuntu version, which is 24.04...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it would be only for command line/server users then I would agree.
However, I think this helps more with desktop/graphical users as they may be lagging behind on the distribution version due to desktop environment, driver, or other related issues. This is probably the situation where more people would want to run the precompiled toolchain on their system.
If needed, in the future more configurations could be added.