Skip to content

Commit

Permalink
feat: Split GHA pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
mbevc1 committed Aug 3, 2024
1 parent c66dcf1 commit d41d168
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 37 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on:
push:
branches: [ "main" ]
pull_request:
branches:
- '**'
workflow_dispatch: {}

name: Build
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
#go-version: 'stable'
go-version-file: 'go.mod'
check-latest: true
id: go

- name: Lint
run: |
go mod tidy
make fmt
make vet
#go get -u golang.org/x/lint/golint
#make lint
if: success()

- name: Test
run: make test
if: success()

- name: Build
run: go build -mod vendor ./...
if: success()
40 changes: 3 additions & 37 deletions .github/workflows/main.yaml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,18 @@
on:
push:
branches:
- '**'
tags:
- 'v*'
#tag-ignore:
# - 'v*'
workflow_dispatch: {}

name: aws-utils
name: Release
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
#go-version: 'stable'
go-version-file: 'go.mod'
check-latest: true
id: go

- name: Lint
run: |
go mod tidy
make fmt
make vet
#go get -u golang.org/x/lint/golint
#make lint
if: success()

- name: Test
run: make test
if: success()

- name: Build
run: go build -mod vendor ./...
if: success()

release:
if: startsWith(github.ref, 'refs/tags/v')
name: Release
runs-on: ubuntu-latest
needs: [ test ]
#needs: [ test ]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -56,7 +22,7 @@ jobs:
#- name: Unshallow
# run: git fetch --prune --unshallow

- name: Set up Go 1.x
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
Expand Down

0 comments on commit d41d168

Please sign in to comment.