Skip to content

Commit

Permalink
update templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Songmu committed Jun 16, 2023
1 parent f36eab9 commit 1dca7ab
Show file tree
Hide file tree
Showing 22 changed files with 266 additions and 65 deletions.
38 changes: 18 additions & 20 deletions .github/workflows/reviewdog.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
name: reviewdog
on: [pull_request]

jobs:
staticcheck:
name: staticcheck
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
persist-credentials: false
- name: staticcheck
uses: reviewdog/action-staticcheck@v1
with:
reporter: github-pr-review
level: warning
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: reviewdog/action-staticcheck@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
level: warning
misspell:
name: misspell
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
persist-credentials: false
- name: misspell
uses: reviewdog/action-misspell@v1
with:
reporter: github-pr-review
level: warning
locale: "US"
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
persist-credentials: false
- name: misspell
uses: reviewdog/action-misspell@v1
with:
reporter: github-pr-review
level: warning
locale: "US"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
- uses: actions/checkout@v3
- uses: reviewdog/action-staticcheck@v1
with:
github_token: ${{ secrets.github_token }}
github_token: {{ "${{ secrets.github_token }}" }}
reporter: github-pr-review
fail_on_error: true
25 changes: 25 additions & 0 deletions testdata/assets/_common/.github/workflows/tagpr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: tagpr
on:
push:
branches:
- "main"
jobs:
tagpr:
runs-on: ubuntu-latest
steps:
- name: setup go
uses: actions/setup-go@v3
with:
go-version: 1.x
- name: checkout
uses: actions/checkout@v3
- name: tagpr
id: tagpr
uses: Songmu/tagpr@v1
env:
GITHUB_TOKEN: {{ "${{ secrets.GITHUB_TOKEN }}" }}
- uses: ./.github/actions/release
with:
tag: {{ "${{ steps.tagpr.outputs.tag }}" }}
token: {{ "${{ secrets.GITHUB_TOKEN }}" }}
if: "steps.tagpr.outputs.tag != ''"
11 changes: 5 additions & 6 deletions testdata/assets/_common/.github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- "**"
pull_request: {}
jobs:
test:
runs-on: {{ "${{ matrix.os }}" }}
Expand All @@ -15,18 +14,18 @@ jobs:
- macOS-latest
- windows-latest
steps:
- name: setup go
uses: actions/setup-go@v3
with:
go-version: 1.x
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
if: "matrix.os == 'windows-latest'"
- name: checkout
uses: actions/checkout@v3
- name: setup go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: test
run: go test -race -coverprofile coverage.out -covermode atomic ./...
- name: Send coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
5 changes: 5 additions & 0 deletions testdata/assets/_common/.tagpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[tagpr]
vPrefix = true
releaseBranch = main
versionFile = version.go
release = draft
22 changes: 22 additions & 0 deletions testdata/assets/basic/.github/actions/release/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: release
description: release {{.Package}}
inputs:
tag:
description: tag name to be released
default: ''
token:
description: GitHub token
required: true
runs:
using: composite
steps:
- name: setup go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: release
run: |
make crossbuild upload
shell: bash
env:
GITHUB_TOKEN: {{ "${{ inputs.token }}" }}
12 changes: 2 additions & 10 deletions testdata/assets/basic/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,8 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- name: setup go
uses: actions/setup-go@v3
with:
go-version: 1.x
- name: checkout
uses: actions/checkout@v3
- uses: ./.github/actions/release
with:
fetch-depth: 0
- name: release
env:
GITHUB_TOKEN: {{ "${{ secrets.github_token }}" }}
run: |
make crossbuild upload
token: {{ "${{ secrets.GITHUB_TOKEN }}" }}
13 changes: 13 additions & 0 deletions testdata/assets/basic/.github/workflows/reviewdog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: reviewdog
on: [pull_request]
jobs:
staticcheck:
name: staticcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: reviewdog/action-staticcheck@v1
with:
github_token: {{ "${{ secrets.github_token }}" }}
reporter: github-pr-review
fail_on_error: true
25 changes: 25 additions & 0 deletions testdata/assets/basic/.github/workflows/tagpr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: tagpr
on:
push:
branches:
- "main"
jobs:
tagpr:
runs-on: ubuntu-latest
steps:
- name: setup go
uses: actions/setup-go@v3
with:
go-version: 1.x
- name: checkout
uses: actions/checkout@v3
- name: tagpr
id: tagpr
uses: Songmu/tagpr@v1
env:
GITHUB_TOKEN: {{ "${{ secrets.GITHUB_TOKEN }}" }}
- uses: ./.github/actions/release
with:
tag: {{ "${{ steps.tagpr.outputs.tag }}" }}
token: {{ "${{ secrets.GITHUB_TOKEN }}" }}
if: "steps.tagpr.outputs.tag != ''"
11 changes: 5 additions & 6 deletions testdata/assets/basic/.github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- "**"
pull_request: {}
jobs:
test:
runs-on: {{ "${{ matrix.os }}" }}
Expand All @@ -15,18 +14,18 @@ jobs:
- macOS-latest
- windows-latest
steps:
- name: setup go
uses: actions/setup-go@v3
with:
go-version: 1.x
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
if: "matrix.os == 'windows-latest'"
- name: checkout
uses: actions/checkout@v3
- name: setup go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: test
run: go test -race -coverprofile coverage.out -covermode atomic ./...
- name: Send coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
5 changes: 5 additions & 0 deletions testdata/assets/basic/.tagpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[tagpr]
vPrefix = true
releaseBranch = main
versionFile = version.go
release = draft
16 changes: 16 additions & 0 deletions testdata/assets/simple/.github/actions/release/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: release
description: release {{.Package}}
inputs:
tag:
description: tag name to be released
default: ''
token:
description: GitHub token
required: true
runs:
using: composite
steps:
- name: release
run: |
echo done
shell: bash
13 changes: 13 additions & 0 deletions testdata/assets/simple/.github/workflows/reviewdog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: reviewdog
on: [pull_request]
jobs:
staticcheck:
name: staticcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: reviewdog/action-staticcheck@v1
with:
github_token: {{ "${{ secrets.github_token }}" }}
reporter: github-pr-review
fail_on_error: true
25 changes: 25 additions & 0 deletions testdata/assets/simple/.github/workflows/tagpr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: tagpr
on:
push:
branches:
- "main"
jobs:
tagpr:
runs-on: ubuntu-latest
steps:
- name: setup go
uses: actions/setup-go@v3
with:
go-version: 1.x
- name: checkout
uses: actions/checkout@v3
- name: tagpr
id: tagpr
uses: Songmu/tagpr@v1
env:
GITHUB_TOKEN: {{ "${{ secrets.GITHUB_TOKEN }}" }}
- uses: ./.github/actions/release
with:
tag: {{ "${{ steps.tagpr.outputs.tag }}" }}
token: {{ "${{ secrets.GITHUB_TOKEN }}" }}
if: "steps.tagpr.outputs.tag != ''"
11 changes: 5 additions & 6 deletions testdata/assets/simple/.github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- "**"
pull_request: {}
jobs:
test:
runs-on: {{ "${{ matrix.os }}" }}
Expand All @@ -15,18 +14,18 @@ jobs:
- macOS-latest
- windows-latest
steps:
- name: setup go
uses: actions/setup-go@v3
with:
go-version: 1.x
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
if: "matrix.os == 'windows-latest'"
- name: checkout
uses: actions/checkout@v3
- name: setup go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: test
run: go test -race -coverprofile coverage.out -covermode atomic ./...
- name: Send coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
5 changes: 5 additions & 0 deletions testdata/assets/simple/.tagpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[tagpr]
vPrefix = true
releaseBranch = main
versionFile = version.go
release = draft
26 changes: 26 additions & 0 deletions testdata/assets/web/.github/actions/release/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: release
description: release {{.Package}}
inputs:
tag:
description: tag name to be released
default: ''
token:
description: GitHub token
required: true
runs:
using: composite
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: setup go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: release
env:
GITHUB_TOKEN: {{ "${{ inputs.token }}" }}
run: |
make crossbuild upload
shell: bash
12 changes: 2 additions & 10 deletions testdata/assets/web/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,8 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- name: setup go
uses: actions/setup-go@v3
with:
go-version: 1.x
- name: checkout
uses: actions/checkout@v3
- uses: ./.github/actions/release
with:
fetch-depth: 0
- name: release
env:
GITHUB_TOKEN: {{ "${{ secrets.github_token }}" }}
run: |
make crossbuild upload
token: {{ "${{ secrets.GITHUB_TOKEN }}" }}
13 changes: 13 additions & 0 deletions testdata/assets/web/.github/workflows/reviewdog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: reviewdog
on: [pull_request]
jobs:
staticcheck:
name: staticcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: reviewdog/action-staticcheck@v1
with:
github_token: {{ "${{ secrets.github_token }}" }}
reporter: github-pr-review
fail_on_error: true
Loading

0 comments on commit 1dca7ab

Please sign in to comment.