chore(deps): bump golang.org/x/crypto from 0.29.0 to 0.31.0 in the go_modules group #15
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
name: Pull Request | |
on: | |
merge_group: | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3.5.2 | |
- name: Set up Go | |
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version-file: './go.mod' | |
cache-dependency-path: './go.sum' | |
check-latest: true | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1 | |
with: | |
version: latest | |
args: -v -c .golangci.yaml | |
tests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3.5.2 | |
- name: Set up Go | |
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version-file: './go.mod' | |
cache-dependency-path: './go.sum' | |
check-latest: true | |
- id: go-cache-paths | |
name: Get Go cache paths | |
run: | | |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT | |
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT | |
- name: Tests | |
run: make test | |
- name: upload coverage to codecov | |
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1 | |
with: | |
files: ./coverageunit.out | |
verbose: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
govulncheck: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3.5.2 | |
- name: Run govulncheck | |
uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1.0.4 | |
with: | |
go-version-file: go.mod | |
docker-tests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3.5.2 | |
- name: Set up Go | |
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version-file: './go.mod' | |
cache-dependency-path: './go.sum' | |
check-latest: true | |
- id: go-cache-paths | |
name: Get Go cache paths | |
run: | | |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT | |
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 | |
- name: Build and push openfga/openfga:dockertest | |
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0 | |
with: | |
file: Dockerfile | |
push: false # don't publish the built container for Docker tests | |
load: true | |
tags: "openfga/openfga:dockertest" | |
- name: Docker Tests | |
run: make test-docker | |
go-bench: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3.5.2 | |
with: | |
fetch-depth: 0 # to be able to retrieve the last commit in main | |
- name: Set up Go | |
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version-file: './go.mod' | |
cache-dependency-path: './go.sum' | |
check-latest: true | |
# Run benchmark with `go test -bench` and stores the output to a file | |
- name: Run benchmark | |
run: | | |
set -o pipefail | |
make test-bench | tee ${{ github.sha }}_bench_output.txt | |
- name: Get CPU information | |
uses: kenchan0130/actions-system-info@c74331947b5734764feeb375de4038960f2576bd # v1 | |
id: system-info | |
- name: Get Main branch SHA | |
id: get-main-branch-sha | |
run: | | |
SHA=$(git rev-parse origin/main) | |
echo "sha=$SHA" >> $GITHUB_OUTPUT | |
- name: Get benchmark JSON from main branch | |
id: cache | |
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: ./cache/benchmark-data.json | |
key: ${{ steps.get-main-branch-sha.outputs.sha }}-${{ runner.os }}-${{ steps.system-info.outputs.cpu-model }}-go-benchmark | |
- name: Compare benchmarks with Main | |
uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 # v1.20.4 | |
if: steps.cache.outputs.cache-hit == 'true' | |
with: | |
# What benchmark tool the output.txt came from | |
tool: 'go' | |
# Where the output from the benchmark tool is stored | |
output-file-path: ${{ github.sha }}_bench_output.txt | |
# Where the benchmarks in main are (to compare) | |
external-data-json-path: ./cache/benchmark-data.json | |
# Do not save the data | |
save-data-file: false | |
# Workflow will fail when an alert happens | |
fail-on-alert: true | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# Enable Job Summary for PRs | |
summary-always: true | |
- name: Run benchmarks but don't compare to Main branch | |
uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 # v1.20.4 | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
# What benchmark tool the output.txt came from | |
tool: 'go' | |
# Where the output from the benchmark tool is stored | |
output-file-path: ${{ github.sha }}_bench_output.txt | |
# Write benchmarks to this file, do not publish to GitHub Pages | |
save-data-file: false | |
external-data-json-path: ./cache/benchmark-data.json | |
# Enable Job Summary for PRs | |
summary-always: true |