-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from cropalato/new_actions
New actions
- Loading branch information
Showing
9 changed files
with
99 additions
and
156 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Merged PR | ||
on: | ||
pull_request: | ||
branches: | ||
- "main" | ||
types: [opened, synchronize, closed] | ||
jobs: | ||
build-project: | ||
if: ((github.event.action == 'closed' && github.event.pull_request.merged == true)) | ||
strategy: | ||
matrix: | ||
go: [1.18] | ||
os: [ubuntu] | ||
name: Build golang application | ||
runs-on: ${{ matrix.os}}-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Setup Go environment | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
- run: go build -o test-${{ matrix.os }} | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-${{ matrix.os }} | ||
path: ./ | ||
release-project: | ||
if: ((github.event.action == 'closed' && github.event.pull_request.merged == true)) | ||
strategy: | ||
matrix: | ||
#os: [macos, windows, ubuntu] | ||
os: [ubuntu] | ||
name: Release golang application | ||
runs-on: ubuntu-latest | ||
needs: build-project | ||
steps: | ||
- name: Download applications | ||
uses: actions/download-artifact@v3 | ||
#with: | ||
#name: test-${{ matrix.os }} | ||
- run: ls -la | ||
- name: Create Github release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: test | ||
allowUpdates: true | ||
artifacts: "**/test-*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Push | ||
on: | ||
push: | ||
branches: | ||
- "**" | ||
- "!main" | ||
jobs: | ||
build-project: | ||
strategy: | ||
matrix: | ||
go: [1.18] | ||
os: [ubuntu] | ||
name: Checking golang application | ||
runs-on: ${{ matrix.os}}-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Setup Go environment | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
repos: | ||
- repo: https://github.com/dnephin/pre-commit-golang | ||
rev: v0.4.0 | ||
hooks: | ||
- id: go-fmt | ||
- id: go-vet | ||
- id: go-lint | ||
- id: go-imports | ||
- id: go-cyclo | ||
args: [-over=15] | ||
- id: validate-toml | ||
- id: no-go-testing | ||
- id: golangci-lint | ||
- id: go-critic | ||
- id: go-unit-tests | ||
- id: go-build | ||
- id: go-mod-tidy | ||
- repo: https://github.com/Bahjat/pre-commit-golang | ||
rev: v1.0.1 | ||
hooks: | ||
- id: go-fmt-import | ||
- id: go-vet | ||
- id: go-lint | ||
- id: go-unit-tests | ||
- id: gofumpt # requires github.com/mvdan/gofumpt | ||
- id: go-err-check # requires github.com/kisielk/errcheck | ||
- id: go-static-check # install https://staticcheck.io/docs/ | ||
- id: golangci-lint # requires github.com/golangci/golangci-lint | ||
args: [--config=.github/linters/.golangci.yml] # optional |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters