Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Simplify testing for examples #1656

Merged
merged 3 commits into from
Nov 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 9 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@ on:
## Every Monday at 2am.
- cron: 0 2 * * 1

env:
CI_ERLANG_MK: 1
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

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 @@ -34,6 +35,7 @@ jobs:
check:
name: Cowboy
needs: cleanup-master
if: ${{ !cancelled() }}
uses: ninenines/ci.erlang.mk/.github/workflows/ci.yaml@master

# The examples test suite is nice to run but typically not
Expand All @@ -43,32 +45,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
Loading