Ubuntu Distcheck #65
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: Ubuntu Distcheck | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build and Distcheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| token: ${{ secrets.PAT_TOKEN }} # Need a token so I can push to submodule repo | |
| # Need be at the HEAD of the badges repo so we can commit to it later. | |
| # Otherwise, the submodule would be in detached head state. | |
| - name: Update Submodule to HEAD | |
| run: | | |
| cd ./badges # Enter the submodule directory | |
| git checkout master | |
| git pull origin master | |
| cd .. | |
| - name: Install packages | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq \ | |
| texlive \ | |
| texlive-plain-generic \ | |
| texinfo \ | |
| autoconf \ | |
| libtool \ | |
| gettext \ | |
| autopoint \ | |
| gperf \ | |
| pkg-config \ | |
| lzip \ | |
| libgc-dev \ | |
| libgmp-dev \ | |
| libltdl-dev \ | |
| libncurses5-dev \ | |
| libreadline-dev \ | |
| libunistring-dev | |
| - name: Configure | |
| run: | | |
| export LANG=C.UTF-8 TERM=dumb VERBOSE=true DEBIAN_FRONTEND=noninteractive TZ=America/Los_Angeles | |
| export TOP="$(pwd)" | |
| mkdir -p "$TOP/app" | |
| cd guile | |
| ./autogen.sh | |
| ./configure CFLAGS="-g -O2 -Wall -Wno-error" --prefix="$TOP/app" | |
| - name: Build | |
| run: | | |
| cd guile | |
| make -j$(nproc) V=1 | |
| continue-on-error: true | |
| - name: Run Dist Check | |
| id: distcheck | |
| run: | | |
| cd guile | |
| make -j$(nproc) distcheck V=1 | |
| continue-on-error: true # Allows the workflow to continue even if this fails | |
| # Step to handle the distcheck failure case | |
| - name: Handle Distcheck Failure | |
| if: steps.distcheck.outcome != 'success' | |
| run: | | |
| # Create the failure badge | |
| mkdir -p ./badges/${{ github.repository }}/${{ github.ref_name }}/ | |
| bash ./verbose-waffle/scripts/basic.sh 'Ubuntu Distcheck' 'failure' 'red' > ./badges/${{ github.repository }}/${{ github.ref_name }}//ubuntu_distcheck.svg | |
| # Configure git | |
| git config --global user.name "GitHub Action" | |
| git config --global user.email "[email protected]" | |
| # Stage and commit the badge in the submodule | |
| cd ./badges | |
| git pull | |
| git add ./${{ github.repository }}/${{ github.ref_name }}/ubuntu_distcheck.svg | |
| git commit -m "Update Ubuntu Distcheck badge to failure" | |
| # Push the submodule changes | |
| git push origin master | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Fail the workflow if distcheck failed | |
| - name: Check Distcheck Result | |
| if: steps.distcheck.outcome != 'success' | |
| run: exit 1 | |
| - name: Make Source Package | |
| run: | | |
| cd guile | |
| gunzip *.tar.gz # Unzip to avoid double compression in artifact | |
| - name: Archive Source Package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Source Package | |
| path: | | |
| guile/*.tar | |
| guile/**/*.log | |
| # Step to handle the distcheck success case | |
| - name: Handle Distcheck Success | |
| run: | | |
| # Create the success badge | |
| mkdir -p ./badges/${{ github.repository }}/${{ github.ref_name }}/ | |
| bash ./verbose-waffle/scripts/basic.sh 'Ubuntu Distcheck' 'success' 'green' > ./badges/${{ github.repository }}/${{ github.ref_name }}/ubuntu_distcheck.svg | |
| # Configure git | |
| git config --global user.name "GitHub Action" | |
| git config --global user.email "[email protected]" | |
| # Stage and commit the badge in the submodule | |
| cd ./badges | |
| git pull | |
| git add ./${{ github.repository }}/${{ github.ref_name }}/ubuntu_distcheck.svg | |
| git commit -m "Update Ubuntu Distcheck badge to success" | |
| # Push the submodule changes | |
| git push origin master | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |