chore: Update Ubuntu versions from 20.04/22.04 to 24.04 in GitHub workflows #175
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: Build and Test | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' #Do not need to run CI for markdown changes. | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' | |
| workflow_dispatch: | |
| jobs: | |
| build-test: | |
| strategy: | |
| # We want to know the status of all OTP versions, not just if one of them fails. | |
| fail-fast: false | |
| matrix: | |
| versions: | |
| - {os: 'ubuntu-24.04', otp: '21.x', rebar: '3.15.2'} | |
| - {os: 'ubuntu-24.04', otp: '25.x', rebar: '3.18.0'} | |
| - {os: 'ubuntu-24.04', otp: '27.x', rebar: '3.23.0'} | |
| runs-on: ${{ matrix.versions.os }} | |
| name: Build and Test - ${{ matrix.versions.otp }} | |
| steps: | |
| - name: Install kerl | |
| run: | | |
| curl -s https://raw.githubusercontent.com/kerl/kerl/master/kerl > /tmp/kerl | |
| chmod a+x /tmp/kerl | |
| - name: Install Erlang OTP | |
| run: | | |
| # Map OTP version patterns to specific versions | |
| if [[ "${{ matrix.versions.otp }}" == "21.x" ]]; then | |
| OTP_VERSION="21.3.8.24" | |
| elif [[ "${{ matrix.versions.otp }}" == "25.x" ]]; then | |
| OTP_VERSION="25.3.2.19" | |
| elif [[ "${{ matrix.versions.otp }}" == "27.x" ]]; then | |
| OTP_VERSION="27.3.2" | |
| else | |
| echo "Unsupported OTP version: ${{ matrix.versions.otp }}" | |
| exit 1 | |
| fi | |
| # Build and install Erlang | |
| /tmp/kerl build $OTP_VERSION $OTP_VERSION | |
| /tmp/kerl install $OTP_VERSION ~/otp/$OTP_VERSION | |
| . ~/otp/$OTP_VERSION/activate | |
| # Install specific rebar3 version | |
| mkdir -p ~/bin | |
| REBAR_VERSION="${{ matrix.versions.rebar }}" | |
| curl -s https://github.com/erlang/rebar3/releases/download/${REBAR_VERSION}/rebar3 -o ~/bin/rebar3 | |
| chmod +x ~/bin/rebar3 | |
| export PATH="$HOME/bin:$PATH" | |
| echo "PATH=$HOME/bin:$PATH" >> $GITHUB_ENV | |
| # Verify installation | |
| echo "Installed Erlang version:" | |
| erl -noshell -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().' | |
| echo "Installed rebar3 version:" | |
| ~/bin/rebar3 --version | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ./.github/actions/ci | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| env: | |
| OTP_VER: ${{ matrix.versions.otp }} |