Skip to content

Commit

Permalink
feat: add the new workflows and remove codecov badge
Browse files Browse the repository at this point in the history
  • Loading branch information
benjivesterby committed Feb 29, 2024
1 parent ee8c9c5 commit 6f59563
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 126 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: automerge
uses: "pascalgn/automerge-action@v0.15.2"
uses: "pascalgn/automerge-action@v0.15.6"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_METHOD: squash
Expand Down
36 changes: 5 additions & 31 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,11 @@ permissions:
contents: write
deployments: write

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

jobs:
benchmark:
name: Execute Benchmarks
strategy:
matrix:
go-version: [1.18.x]
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
stable: false
- name: Checkout code
uses: actions/checkout@v3
- name: Run benchmark
run: go test -bench=. ./... | tee output.txt
- name: Download previous benchmark data
uses: actions/cache@v3
with:
path: ./cache
key: ${{ runner.os }}-benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Benchmark Results
tool: 'go'
output-file-path: output.txt
benchmark-data-dir-path: dev/bench
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
alert-threshold: '200%'
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: '@benjivesterby'
uses: devnw/workflows/.github/workflows/make-bench.yml@main
secrets: inherit # pragma: allowlist secret
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.18.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: true
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
stable: false
- name: Checkout code
uses: actions/checkout@v3
- name: Build
run: go build ./...
test:
name: "Unit Tests"
needs: [build]
strategy:
matrix:
go-version: [1.18.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@v3
with:
go-version: ${{ matrix.go-version }}
stable: false
- name: Test
run: go test -failfast ./... -race -coverprofile=coverage.txt -covermode=atomic
- name: Push Coverage to codecov.io
uses: codecov/codecov-action@v3.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
pre-release:
name: "Pre Release"
if: github.event_name != 'pull_request'
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: spyderorg/workflows/.github/workflows/make-build-nix.yml@main
secrets: inherit # pragma: allowlist secret
47 changes: 47 additions & 0 deletions .github/workflows/gitstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Code generated by gitStream GitHub app - DO NOT EDIT

name: gitStream workflow automation

on:
workflow_dispatch:
inputs:
client_payload:
description: The Client payload
required: true
full_repository:
description: the repository name include the owner in `owner/repo_name` format
required: true
head_ref:
description: the head sha
required: true
base_ref:
description: the base ref
required: true
installation_id:
description: the installation id
required: false
resolver_url:
description: the resolver url to pass results to
required: true
resolver_token:
description: Optional resolver token for resolver service
required: false
default: ''

jobs:
gitStream:
timeout-minutes: 5
runs-on: ubuntu-latest
name: gitStream workflow automation
steps:
- name: Evaluate Rules
uses: linear-b/gitstream-github-action@v1
id: rules-engine
with:
full_repository: ${{ github.event.inputs.full_repository }}
head_ref: ${{ github.event.inputs.head_ref }}
base_ref: ${{ github.event.inputs.base_ref }}
client_payload: ${{ github.event.inputs.client_payload }}
installation_id: ${{ github.event.inputs.installation_id }}
resolver_url: ${{ github.event.inputs.resolver_url }}
resolver_token: ${{ github.event.inputs.resolver_token }}
38 changes: 5 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,11 @@ on:
push:
tags:
- "v*"
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_PAT }}

jobs:
build:
name: "Build & Unit Tests"
strategy:
matrix:
go-version: [1.18.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@v3
with:
go-version: ${{ matrix.go-version }}
stable: false
- name: Build
run: go build ./...
- name: Test
run: go test -race -failfast ./...
release:
needs: [build]
name: "Tagged Release"
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create Github Release from Tag
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
LICENSE
name: Tagged Release
uses: spyderorg/workflows/.github/workflows/make-release.yml@main
secrets: inherit # pragma: allowlist secret
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![Build & Test Action Status](https://github.com/devnw/gen/actions/workflows/build.yml/badge.svg)](https://github.com/devnw/gen/actions)
[![Go Report Card](https://goreportcard.com/badge/go.devnw.com/gen)](https://goreportcard.com/report/go.devnw.com/gen)
[![codecov](https://codecov.io/gh/devnw/gen/branch/main/graph/badge.svg)](https://codecov.io/gh/devnw/gen)
[![Go Reference](https://pkg.go.dev/badge/go.devnw.com/gen.svg)](https://pkg.go.dev/go.devnw.com/gen)
[![License: Apache 2.0](https://img.shields.io/badge/license-Apache-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
Expand Down

0 comments on commit 6f59563

Please sign in to comment.