-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use reusable workflows and shared renovate config (#61)
- Loading branch information
1 parent
07d0bda
commit 1b8bd12
Showing
4 changed files
with
22 additions
and
129 deletions.
There are no files selected for viewing
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,6 @@ | ||
{ | ||
$schema: 'https://docs.renovatebot.com/renovate-schema.json', | ||
extends: [ | ||
'github>HyperaDev/actions', | ||
], | ||
} |
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,64 +1,17 @@ | ||
# GitHub Actions workflow to build, test and publish the project. | ||
# GitHub Actions workflow to build and test a Go project. | ||
name: "Go" | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
GO_VERSION: "1.21.3" | ||
merge_group: | ||
|
||
jobs: | ||
govulncheck: | ||
name: "Vulnerability Check" | ||
runs-on: "ubuntu-latest" | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Set up Go ${{ env.GO_VERSION }}" | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "${{ env.GO_VERSION }}" | ||
cache: true | ||
|
||
- name: "Install" | ||
run: go install golang.org/x/vuln/cmd/govulncheck@latest | ||
|
||
- name: "Run" | ||
run: govulncheck ./... | ||
|
||
build: | ||
name: "Build" | ||
runs-on: "ubuntu-latest" | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Set up Go ${{ env.GO_VERSION }}" | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "${{ env.GO_VERSION }}" | ||
cache: true | ||
|
||
- name: "Download dependencies" | ||
run: go mod download | ||
|
||
- name: "Verify dependencies" | ||
run: go mod verify | ||
|
||
- name: "Build" | ||
run: go build -v ./... | ||
|
||
- name: "Test" | ||
run: go test -v ./... | ||
|
||
- name: "Test (race)" | ||
run: go test -race -v ./... | ||
|
||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
uses: HyperaDev/actions/.github/workflows/go-build.yml@main | ||
with: | ||
go_version: "stable" | ||
codecov_enabled: true | ||
vulncheck_enabled: true |
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,67 +1,17 @@ | ||
# GitHub Actions workflow to create a new release | ||
# GitHub Actions workflow to release a Go project using GoReleaser. | ||
# Releases are published from tags matching "v*.*.*". | ||
name: "Release" | ||
on: | ||
push: | ||
tags: [ "v*.*.*" ] | ||
|
||
concurrency: | ||
group: release | ||
cancel-in-progress: true | ||
|
||
env: | ||
GO_VERSION: "1.21.3" | ||
|
||
jobs: | ||
release: | ||
name: "Release" | ||
runs-on: "ubuntu-latest" | ||
permissions: | ||
contents: read | ||
packages: write | ||
env: | ||
DOCKER_CLI_EXPERIMENTAL: enabled | ||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: "Set up Go ${{ env.GO_VERSION }}" | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "${{ env.GO_VERSION }}" | ||
cache: true | ||
check-latest: true | ||
|
||
- name: "Run go mod tidy" | ||
run: go mod tidy | ||
|
||
- name: "Set up QEMU" | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: "Set up Docker Buildx" | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: "Login to DockerHub" | ||
uses: docker/login-action@v3 | ||
with: | ||
username: "${{ secrets.DOCKERHUB_USERNAME }}" | ||
password: "${{ secrets.DOCKERHUB_TOKEN }}" | ||
|
||
- name: "Login to GitHub Container Registry" | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: "${{ github.repository_owner }}" | ||
password: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: "Release" | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
version: "latest" | ||
distribution: "goreleaser" | ||
args: "release --clean" | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.BOT_GITHUB_TOKEN }}" | ||
|
||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
uses: HyperaDev/actions/.github/workflows/go-release.yml@main | ||
with: | ||
docker_enabled: true | ||
secrets: | ||
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}" | ||
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}" | ||
GITHUB_RELEASE_TOKEN: "${{ secrets.BOT_GITHUB_TOKEN }}" |