diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml index 906400c..d7af3af 100644 --- a/.github/actions/ci/action.yml +++ b/.github/actions/ci/action.yml @@ -17,7 +17,7 @@ runs: steps: - run: make compile shell: bash - - uses: supercharge/redis-github-action@1.6.0 + - uses: supercharge/redis-github-action@ea9b21c6ecece47bd99595c532e481390ea0f044 - run: make ci-tests shell: bash - uses: ./.github/actions/build-docs @@ -25,9 +25,10 @@ runs: shell: bash - run: make build-contract-tests shell: bash - - run: make start-contract-test-service-bg + - name: Start contract test service shell: bash - - uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1.0.2 + run: make start-contract-test-service-bg + - uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1.1.0 with: test_service_port: 8000 token: ${{ inputs.github_token }} diff --git a/.github/actions/install-erlang/action.yml b/.github/actions/install-erlang/action.yml new file mode 100644 index 0000000..76f4738 --- /dev/null +++ b/.github/actions/install-erlang/action.yml @@ -0,0 +1,50 @@ +name: 'Install Erlang OTP and rebar3' +description: 'Installs a specific version of Erlang OTP and rebar3' +inputs: + otp_version: + description: 'The OTP version to install' + required: false + default: '25.3.2.19' + rebar_version: + description: 'The rebar3 version to install' + required: false + default: '174fd9070195443d693d444ecd1f2b7aa91661fe' # 3.18.0 +runs: + using: "composite" + steps: + + - name: Install kerl + shell: bash + run: | + curl -s https://raw.githubusercontent.com/kerl/kerl/master/kerl > /tmp/kerl + chmod a+x /tmp/kerl + + - name: Install Erlang OTP and rebar3 + shell: bash + run: | + # Build and install Erlang + /tmp/kerl build ${{ inputs.otp_version }} ${{ inputs.otp_version }} + /tmp/kerl install ${{ inputs.otp_version }} ~/otp/${{ inputs.otp_version }} + # This will make the erlang version available to the current shell. + . ~/otp/${{ inputs.otp_version }}/activate + # Persist to the github actions path for use in future steps. + echo "$HOME/otp/${{ inputs.otp_version }}/bin" >> "$GITHUB_PATH" + + # Install specific rebar3 version + cd ~/ + git clone https://github.com/erlang/rebar3.git + cd rebar3 + git checkout ${{ matrix.versions.rebar }} + ./bootstrap + ./rebar3 local install + + # Add to the path for use in this step. + export PATH=$HOME/otp/${{ inputs.otp_version }}/.cache/rebar3/bin:$PATH + # Persist to the github actions path for use in future steps. + echo "$HOME/otp/${{ inputs.otp_version }}/.cache/rebar3/bin" >> "$GITHUB_PATH" + + # Verify installation + echo "Installed Erlang version:" + erl -noshell -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().' + echo "Installed rebar3 version:" + rebar3 --version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a00350..f29e9db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,23 +18,24 @@ jobs: fail-fast: false matrix: versions: - - {os: 'ubuntu-20.04', otp: '21.x', rebar: '3.15.2'} - - {os: 'ubuntu-22.04', otp: '25.x', rebar: '3.18.0'} - - {os: 'ubuntu-22.04', otp: '27.x', rebar: '3.23.0'} + - { otp: "21.3.8.24", rebar: "0be8717a4ff5b4a0c3dcef5031fe9833197d861e" } # rebar 3.15.2 + - { otp: "25.3.2.19", rebar: "174fd9070195443d693d444ecd1f2b7aa91661fe" } # rebar 3.18.0 + - { otp: "27.3.2", rebar: "bde4b54248d16280b2c70a244aca3bb7566e2033" } # rebar 3.23.0 - runs-on: ${{ matrix.versions.os }} + runs-on: ubuntu-24.04 name: Build and Test - ${{ matrix.versions.otp }} steps: - - uses: erlef/setup-beam@v1 - with: - version-type: loose - otp-version: ${{ matrix.versions.otp }} - rebar3-version: ${{ matrix.versions.rebar }} - uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Install Erlang and rebar3 + uses: ./.github/actions/install-erlang + with: + otp_version: ${{ matrix.versions.otp }} + rebar_version: ${{ matrix.versions.rebar }} + - uses: ./.github/actions/ci with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/manual-publish-docs.yml b/.github/workflows/manual-publish-docs.yml index 62fc6d2..d3b5a7c 100644 --- a/.github/workflows/manual-publish-docs.yml +++ b/.github/workflows/manual-publish-docs.yml @@ -4,18 +4,17 @@ on: name: Publish Documentation jobs: build-publish: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 # Needed to get tokens during publishing. permissions: id-token: write contents: write # Need to publish github pages. steps: - - uses: erlef/setup-beam@v1 - with: - version-type: loose - otp-version: 25.x - rebar3-version: 3.18.0 - uses: actions/checkout@v3 + + - name: Install Erlang and rebar3 + uses: ./.github/actions/install-erlang + - id: build name: Build Documentation uses: ./.github/actions/build-docs diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml index aa8fee5..9bf6a05 100644 --- a/.github/workflows/manual-publish.yml +++ b/.github/workflows/manual-publish.yml @@ -9,18 +9,17 @@ on: jobs: manual-build-publish: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 # Needed to get tokens during publishing. permissions: id-token: write contents: read steps: - - uses: erlef/setup-beam@v1 - with: - version-type: loose - otp-version: 25.x - rebar3-version: 3.18.0 - uses: actions/checkout@v3 + + - name: Install Erlang and rebar3 + uses: ./.github/actions/install-erlang + - id: build-and-test # Build using the same steps from CI. name: Build and Test diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 3ff2d2a..4859ee2 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -7,7 +7,7 @@ on: jobs: release-package: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: id-token: write # Needed if using OIDC to get release secrets. contents: write # Contents and pull-requests are for release-please to make releases. @@ -21,18 +21,15 @@ jobs: token: ${{secrets.GITHUB_TOKEN}} default-branch: main - - uses: erlef/setup-beam@v1 - if: ${{ steps.release.outputs.releases_created }} - with: - version-type: loose - otp-version: 25.x - rebar3-version: 3.18.0 - - uses: actions/checkout@v3 if: ${{ steps.release.outputs.releases_created }} with: fetch-depth: 0 #If you only need the current version keep this. + - name: Install Erlang and rebar3 + if: ${{ steps.release.outputs.releases_created }} + uses: ./.github/actions/install-erlang + - uses: ./.github/actions/configure-rebar with: aws_assume_role: ${{ vars.AWS_ROLE_ARN }}