| name: CI | |
| permissions: | |
| contents: write | |
| on: | |
| - push | |
| - pull_request | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os.image }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - { image: ubuntu-24.04, asset_name_suffix: "", arch: "amd64" } | |
| - { image: ubuntu-24.04-arm, asset_name_suffix: "-aarch64", arch: "arm64" } | |
| version: | |
| - { use_patch: true, asset_name: "gcc-15-without-int128" } | |
| - { use_path: false, asset_name: "gcc-15" } | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Install mpfr | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install gcc-10 libmpfr-dev libmpc-dev | |
| - name: Apply patch to disable 128-bit integers | |
| if: matrix.version.use_patch | |
| run: git apply patches/0001-Disable-128-bit-integers-for-testing-purposes.patch | |
| - name: Build libgccjit | |
| run: | | |
| cd .. | |
| ls | |
| mkdir build install | |
| cd build | |
| ../gcc/configure --enable-host-shared --enable-languages=c,jit,lto --disable-bootstrap --disable-multilib --prefix=/usr | |
| bash -o pipefail -c 'make -j4 2>&1 | tee build.log' | |
| if grep -E 'gcc/jit/.*:.*warning:' build.log; then | |
| echo "Warnings detected in libgccjit" | |
| exit 1 | |
| fi | |
| make install DESTDIR=$(pwd)/../install | |
| - name: Build Debian package | |
| run: | | |
| cd .. | |
| mkdir install/DEBIAN | |
| cat > install/DEBIAN/control << EOF | |
| Package: gcc-15 | |
| Version: 15 | |
| Architecture: ${{ matrix.os.arch }} | |
| Maintainer: Antoni Boucher <bouanto@zoho.com> | |
| Description: gcc 15 for rustc_codegen_gcc CI | |
| EOF | |
| dpkg-deb --root-owner-group --build install | |
| mv install.deb gcc-15.deb | |
| - name: Compute tag name | |
| id: tag_name | |
| run: | | |
| git_hash=$(git rev-parse "$GITHUB_SHA") | |
| echo "TAG_NAME=$git_hash" >> $GITHUB_OUTPUT | |
| - name: Create tag | |
| if: github.ref == 'refs/heads/master' | |
| continue-on-error: true | |
| uses: laputansoft/github-tag-action@v4.6 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| create_annotated_tag: true | |
| tag: master-${{ steps.tag_name.outputs.TAG_NAME }} | |
| - name: Create release | |
| if: github.ref == 'refs/heads/master' && !matrix.version.use_patch | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: /home/runner/work/gcc/install/usr/lib/libgccjit.so.0.0.1 | |
| asset_name: libgccjit${{ matrix.os.asset_name_suffix }}.so | |
| tag: master-${{ steps.tag_name.outputs.TAG_NAME }} | |
| - name: Create release | |
| if: github.ref == 'refs/heads/master' | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: /home/runner/work/gcc/gcc-15.deb | |
| asset_name: ${{ matrix.version.asset_name }}${{ matrix.os.asset_name_suffix }}.deb | |
| tag: master-${{ steps.tag_name.outputs.TAG_NAME }} |