-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(actions): set permissions and timeouts
Signed-off-by: nscuro <[email protected]>
- Loading branch information
Showing
2 changed files
with
71 additions
and
61 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -3,62 +3,67 @@ name: CI | |
on: | ||
push: | ||
branches: | ||
- master | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
- master | ||
|
||
permissions: { } | ||
|
||
jobs: | ||
licensecheck: | ||
name: License Check | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
- name: Check license headers | ||
uses: apache/[email protected] | ||
with: | ||
config: .licenserc.yml | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
- name: Check license headers | ||
uses: apache/[email protected] | ||
with: | ||
config: .licenserc.yml | ||
|
||
lint: | ||
name: Lint | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
- name: Setup Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: "1.17" | ||
check-latest: true | ||
- name: Run golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: latest | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
- name: Setup Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: "1.17" | ||
check-latest: true | ||
- name: Run golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: latest | ||
|
||
test: | ||
name: Test | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: | ||
- "1.15" | ||
- "1.16" | ||
- "1.17" | ||
- "1.15" | ||
- "1.16" | ||
- "1.17" | ||
steps: | ||
- name: Setup Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: ${{ matrix.go }} | ||
check-latest: true | ||
- name: Setup CycloneDX CLI | ||
run: | | ||
mkdir -p "$HOME/.local/bin" | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
wget -O "$HOME/.local/bin/cyclonedx" https://github.com/CycloneDX/cyclonedx-cli/releases/download/v0.22.0/cyclonedx-linux-x64 | ||
echo "ae39404a9dc8b2e7be0a9559781ee9fe3492201d2629de139d702fd4535ffdd6 $HOME/.local/bin/cyclonedx" | sha256sum -c | ||
chmod +x "$HOME/.local/bin/cyclonedx" | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
- name: Test | ||
run: make test | ||
- name: Setup Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: ${{ matrix.go }} | ||
check-latest: true | ||
- name: Setup CycloneDX CLI | ||
run: | | ||
mkdir -p "$HOME/.local/bin" | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
wget -O "$HOME/.local/bin/cyclonedx" https://github.com/CycloneDX/cyclonedx-cli/releases/download/v0.22.0/cyclonedx-linux-x64 | ||
echo "ae39404a9dc8b2e7be0a9559781ee9fe3492201d2629de139d702fd4535ffdd6 $HOME/.local/bin/cyclonedx" | sha256sum -c | ||
chmod +x "$HOME/.local/bin/cyclonedx" | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
- name: Test | ||
run: make 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 |
---|---|---|
@@ -1,32 +1,37 @@ | ||
name: goreleaser | ||
name: GoReleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
name: Release | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: "1.17" | ||
check-latest: true | ||
- name: Generate SBOM | ||
uses: CycloneDX/gh-gomod-generate-sbom@v1 | ||
with: | ||
version: v1 | ||
args: mod -licenses -json -output bom.json -type library -verbose | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: "1.17" | ||
check-latest: true | ||
- name: Generate SBOM | ||
uses: CycloneDX/gh-gomod-generate-sbom@v1 | ||
with: | ||
version: v1 | ||
args: mod -licenses -json -output bom.json -type library -verbose | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |