Skip to content

Commit

Permalink
CI: Simplify testing for examples
Browse files Browse the repository at this point in the history
Since we only test them on Ubuntu we can use setup-beam
to install Erlang/OTP and avoid waiting for all other
checks to complete.

Also make the "delete master" job conditional rather
than only its step.
  • Loading branch information
essen committed Nov 8, 2024
1 parent b1cb95f commit 2848d01
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
cleanup-master:
name: Cleanup master build
runs-on: ubuntu-latest
if: ${{ github.event_name == 'schedule' }}
permissions:
actions: write
steps:

- name: Cleanup master build if necessary
if: ${{ github.event_name == 'schedule' }}
run: |
gh cache delete Linux-X64-Erlang-master -R $REPO || true
gh cache delete macOS-ARM64-Erlang-master -R $REPO || true
Expand All @@ -43,32 +43,19 @@ jobs:

examples:
name: Check examples
needs: check
runs-on: 'ubuntu-latest'
if: ${{ !cancelled() }}
steps:

- name: Checkout repository
uses: actions/checkout@v4

- name: Output latest Erlang/OTP version
id: latest_version
run: |
{
echo "latest<<EOF"
make ci-list | grep -v rc | grep -v master | tail -n1
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Restore CI cache
uses: actions/cache/restore@v4
- name: Install latest Erlang/OTP
uses: erlef/setup-beam@v1
with:
path: |
~/erlang/
key: ${{ runner.os }}-${{ runner.arch }}-Erlang-${{ steps.latest_version.outputs.latest }}
otp-version: latest

- name: Run ct-examples
run: make ct-examples LATEST_ERLANG_OTP=1
run: make ct-examples

- name: Upload logs
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 2848d01

Please sign in to comment.