Skip to content

Commit

Permalink
fix: split workflows again, no testing on main (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
henninge authored Mar 31, 2023
1 parent 7c64197 commit 2cdf448
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,33 +1,17 @@
name: Test and Release
name: Release Main Branch

on:
push:
branches:
- main
pull_request:
branches:
- main
ignore_tags:
- "*"

env:
GO_VERSION: '1.20'
REGISTRY: ghcr.io
IMAGE: ghcr.io/${{ github.repository }}

jobs:
run-tests:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v3

- name: install go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}

- name: run tests
run: make test

build-and-release:
runs-on: ubuntu-latest
Expand All @@ -36,15 +20,11 @@ jobs:
contents: write
packages: write

needs:
- run-tests

if: github.ref == 'refs/heads/main'
steps:
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18

- name: setup release tools
run: npm install -g semantic-release@21 @semantic-release/exec
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run tests

on:
pull_request:
branches:
- main

env:
GO_VERSION: '1.20'

jobs:
run-tests:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v3

- name: install go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}

- name: run tests
run: make test

0 comments on commit 2cdf448

Please sign in to comment.