Skip to content

Commit

Permalink
fix(devops): Release workflow (#652)
Browse files Browse the repository at this point in the history
* Rename master.yml to release.yml

Run on PRs for testing

* Skip running all tests for speed

* Try reverting checkout version

* Revert to a working release workflow

* Add go setup

* Remove fetch depth

* Finalize release workflow

* Test release workflow on PR branch

* Simplify caching

* Fix regex

* Stop running on PR branches

* Remove caching from golangci-lint

Co-authored-by: Mat-Cosmos <97468149+matthiasmatt@users.noreply.github.com>
  • Loading branch information
NibiruHeisenberg and matthiasmatt committed Jun 24, 2022
1 parent 256ca62 commit 28e50de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-title-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
- uses: seferov/pr-lint-action@master
with:
# taken from https://gist.github.com/marcojahn/482410b728c31b221b70ea6d2c433f0c
title-regex: ' ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)'
title-regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)'
title-regex-flags: 'g' # optional
error-message: 'Please follow conventional commit style: https://www.conventionalcommits.org/en/v1.0.0/' # optional
27 changes: 6 additions & 21 deletions .github/workflows/master.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.17

# https://github.com/actions/cache/blob/main/examples.md#go---modules
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
cache: true

- name: Run all tests.
run: go test -v ./... -cover
Expand All @@ -33,22 +24,16 @@ jobs:
runs-on: ubuntu-latest
needs: all-tests
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.17

# https://github.com/actions/cache/blob/main/examples.md#go---modules
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
cache: true

- name: Bump version and push tag
id: tag_version
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.17

# https://github.com/actions/cache/blob/main/examples.md#go---modules
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
cache: true

- name: Run all unit tests.
run: go test -v ./... -short -cover

0 comments on commit 28e50de

Please sign in to comment.