From da48e1c0d6cf96595bf14f8daead4c0351ea9a4a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Feb 2026 03:58:57 +0000 Subject: [PATCH 1/2] Split CI and publish into separate workflows - ci.yml: runs tests, dialyzer, and xref on all pushes and PRs - publish.yml: only triggers on v* tags with an explicit guard (`if: startsWith(github.ref, 'refs/tags/v')`) on the publish job to prevent publishing on non-tag runs https://claude.ai/code/session_01RBbLduNgvjWctN2Dj12UDY --- .github/workflows/ci.yml | 41 +++++++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 1 + 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1c95fd7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: CI + +on: + push: + branches: ['*'] + pull_request: + branches: [main] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + strategy: + matrix: + otp: ['25', '26', '27'] + steps: + - uses: actions/checkout@v4 + + - uses: erlef/setup-beam@v1 + with: + otp-version: ${{ matrix.otp }} + rebar3-version: '3.24' + + - name: Restore dependencies cache + uses: actions/cache@v4 + with: + path: _build + key: ${{ runner.os }}-otp-${{ matrix.otp }}-build-${{ hashFiles('rebar.config') }} + restore-keys: ${{ runner.os }}-otp-${{ matrix.otp }}-build- + + - name: Compile + run: rebar3 compile + + - name: Run tests + run: rebar3 ct + + - name: Run dialyzer + run: rebar3 dialyzer + + - name: Run xref + run: rebar3 xref diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 734e441..68f7309 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -42,6 +42,7 @@ jobs: publish: name: Publish to Hex.pm needs: test + if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest permissions: contents: read From 97f4c4a97de81d88809fc7284f347691174ef556 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Feb 2026 04:03:05 +0000 Subject: [PATCH 2/2] Run CI on all pushes, guard publish to tag-only Instead of a separate ci.yml (which GitHub Actions won't discover from a feature branch), consolidate into a single workflow that triggers on all pushes and PRs. The test jobs always run; the publish job is guarded with `if: startsWith(github.ref, 'refs/tags/v')` so it only executes on version tag pushes. https://claude.ai/code/session_01RBbLduNgvjWctN2Dj12UDY --- .github/workflows/ci.yml | 41 ----------------------------------- .github/workflows/publish.yml | 8 ++++--- 2 files changed, 5 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 1c95fd7..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: CI - -on: - push: - branches: ['*'] - pull_request: - branches: [main] - -jobs: - test: - name: Test - runs-on: ubuntu-latest - strategy: - matrix: - otp: ['25', '26', '27'] - steps: - - uses: actions/checkout@v4 - - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ matrix.otp }} - rebar3-version: '3.24' - - - name: Restore dependencies cache - uses: actions/cache@v4 - with: - path: _build - key: ${{ runner.os }}-otp-${{ matrix.otp }}-build-${{ hashFiles('rebar.config') }} - restore-keys: ${{ runner.os }}-otp-${{ matrix.otp }}-build- - - - name: Compile - run: rebar3 compile - - - name: Run tests - run: rebar3 ct - - - name: Run dialyzer - run: rebar3 dialyzer - - - name: Run xref - run: rebar3 xref diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 68f7309..f96bc44 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,9 +1,11 @@ -name: Publish to Hex.pm +name: CI on: push: - tags: - - 'v*' + branches: ['*'] + tags: ['v*'] + pull_request: + branches: [main] jobs: test: