diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 8be4b37..5395897 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -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 diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index a2acf5a..39938b3 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fffc381..41fd203 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/gitstream.yml b/.github/workflows/gitstream.yml new file mode 100644 index 0000000..7f1afaa --- /dev/null +++ b/.github/workflows/gitstream.yml @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 30f39a8..13385e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/README.md b/README.md index 0367a04..a820ac5 100644 --- a/README.md +++ b/README.md @@ -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)