From 0797630e7e20cdf7d44d8abd096559719962f272 Mon Sep 17 00:00:00 2001 From: michaelvl Date: Sat, 2 Mar 2024 07:42:12 +0100 Subject: [PATCH] Separate test and release GHA --- .../{build-release.yaml => release.yaml} | 32 +++---------------- .github/workflows/test.yaml | 30 +++++++++++++++++ 2 files changed, 34 insertions(+), 28 deletions(-) rename .github/workflows/{build-release.yaml => release.yaml} (52%) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/build-release.yaml b/.github/workflows/release.yaml similarity index 52% rename from .github/workflows/build-release.yaml rename to .github/workflows/release.yaml index d4852e2..9192735 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/release.yaml @@ -1,41 +1,17 @@ -name: App build and release +name: Release on: push: + tags: + - '**' branches: - - '**' - paths-ignore: - - README.md - - 'docs/**' + - 'main' jobs: - test: - permissions: - contents: read - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0 - with: - go-version-file: "go.mod" - cache: true - - - name: Tests - run: | - make build lint - release: - if: github.ref == 'refs/heads/main' permissions: contents: write runs-on: ubuntu-latest - needs: - - test steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..c15a482 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,30 @@ +name: Test + +on: + push: + branches: + - '**' + paths-ignore: + - README.md + - 'docs/**' + +jobs: + test: + permissions: + contents: read + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0 + with: + go-version-file: "go.mod" + cache: true + + - name: Tests + run: | + make build lint