Skip to content

Commit

Permalink
ci(workflows): move to shared workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
benjivesterby committed Mar 27, 2023
1 parent cbf5eda commit 8754c7a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 88 deletions.
68 changes: 8 additions & 60 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,12 @@
name: Build & Test
name: Lint, Build & Test

# this is triggered on push to the repository
on: [push, pull_request]

env:
GH_ACCESS_TOKEN: ${{ secrets.GH_PAT }}

jobs:
build:
name: "Build"
strategy:
matrix:
go-version: [1.19.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: true
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: Build
run: go build ./...
test:
name: "Unit Tests"
needs: [build]
strategy:
matrix:
go-version: [1.19.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: true
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Fuzz
run: go test -fuzz=./... -fuzztime=10s
- name: Test
run: go test -failfast ./... -race -coverprofile=coverage.txt -covermode=atomic
- name: Push Coverage to codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
pre-release:
name: "Pre Release"
if: github.ref == 'refs/heads/main'
runs-on: "ubuntu-latest"
needs: [build, test]
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "dev"
prerelease: true
title: "Development Build"
files: |
LICENSE
lint-build-test:
name: Lint, Build & Test
uses: devnw/workflows/.github/workflows/build.yml@main
secrets: inherit
29 changes: 3 additions & 26 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,8 @@ on:
push:
branches:
- main

jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19

- name: Generate Go documentation and update README
run: |
go install github.com/robertkrimen/godocdown/godocdown@latest
godocdown . > README.md
- name: Create or update pull request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs(README.md): update go documentation"
title: "Update Go documentation in README"
body: "This PR updates the Go documentation in the README."
branch: "update-go-documentation"
base: "main"
labels: "documentation,automerge"
name: Update README with Go documentation
uses: devnw/workflows/.github/workflows/docs.yml@main
secrets: inherit
23 changes: 21 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,25 @@
"path": "detect_secrets.filters.heuristic.is_templated_secret"
}
],
"results": {},
"generated_at": "2021-12-22T01:30:52Z"
"results": {
".github/workflows/build.yml": [
{
"type": "Secret Keyword",
"filename": ".github/workflows/build.yml",
"hashed_secret": "3e26d6750975d678acb8fa35a0f69237881576b0",
"is_verified": false,
"line_number": 12
}
],
".github/workflows/docs.yml": [
{
"type": "Secret Keyword",
"filename": ".github/workflows/docs.yml",
"hashed_secret": "3e26d6750975d678acb8fa35a0f69237881576b0",
"is_verified": false,
"line_number": 11
}
]
},
"generated_at": "2023-03-27T20:03:18Z"
}

0 comments on commit 8754c7a

Please sign in to comment.