Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 31 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
##
## Build the main branch
##
name: build
on:
push:
Expand All @@ -9,36 +12,52 @@ jobs:

build:
runs-on: ubuntu-latest
steps:
strategy:
matrix:
module: ["."]

steps:
- uses: actions/setup-go@v5
with:
go-version: "1.21"

- uses: actions/checkout@v4

- name: go build
working-directory: ${{ matrix.module }}
run: |
go build ./...

- name: go test
working-directory: ${{ matrix.module }}
run: |
go test -v -coverprofile=profile.cov $(go list ./... | grep -v /examples/)
go test -coverprofile=profile.cov $(go list ./... | grep -v /examples/)
env:
## GOPATH required to build serverless app inside unittest
GOPATH: /home/runner/work/${{ github.event.repository.name }}/go

- uses: shogo82148/actions-goveralls@v1
continue-on-error: true
with:
working-directory: ${{ matrix.module }}
path-to-profile: profile.cov
flag-name: ${{ matrix.module }}
parallel: true

- uses: reecetech/version-increment@2023.10.2
id: version
with:
scheme: semver
increment: patch

- name: publish
- name: release
working-directory: ${{ matrix.module }}
run: |
git config user.name "GitHub Actions"
git config user.email "github-actions@users.noreply.github.com"
git tag ${{ steps.version.outputs.v-version }}
git push origin -u ${{ steps.version.outputs.v-version }}
for mod in `grep -roh "const Version = \".*" * | grep -Eoh "([[:alnum:]]*/*){1,}v[0-9]*\.[0-9]*\.[0-9]*"`
do
git tag $mod 2> /dev/null && git push origin -u $mod 2> /dev/null && echo "[+] $mod" || echo "[ ] $mod"
done

finish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true
25 changes: 0 additions & 25 deletions .github/workflows/check-code.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/check-test.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
##
## Unit Tests & Coverage
##
name: test
on:
pull_request:
types:
- opened
- synchronize

jobs:

unit:
runs-on: ubuntu-latest
strategy:
matrix:
module: ["."]

steps:

- uses: actions/setup-go@v5
with:
go-version: "1.21"

- uses: actions/checkout@v4

- name: go build
working-directory: ${{ matrix.module }}
run: |
go build ./...

- name: go test
working-directory: ${{ matrix.module }}
run: |
go test -coverprofile=profile.cov $(go list ./... | grep -v /examples/)
env:
## GOPATH required to build serverless app inside unittest
GOPATH: /home/runner/work/${{ github.event.repository.name }}/go

- uses: shogo82148/actions-goveralls@v1
continue-on-error: true
with:
working-directory: ${{ matrix.module }}
path-to-profile: profile.cov
flag-name: ${{ matrix.module }}
parallel: true

- uses: dominikh/staticcheck-action@v1.3.1
with:
install-go: false
working-directory: ${{ matrix.module }}

finish:
needs: unit
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true

Loading
Loading