Skip to content

Commit

Permalink
Format workflow files with prettier, use go1.20 for go.mod file
Browse files Browse the repository at this point in the history
  • Loading branch information
gaby committed Sep 2, 2023
1 parent 3d66eb5 commit 7e0ac2a
Show file tree
Hide file tree
Showing 10 changed files with 175 additions and 171 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/auto-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
name: Auto labeler

on:
issues:
types: [ opened, edited, milestoned ]
pull_request_target:
types: [ opened ]
issues:
types: [opened, edited, milestoned]
pull_request_target:
types: [opened]
permissions:
contents: read
issues: write
pull-requests: write
statuses: write
checks: write

jobs:
labeler:
runs-on: ubuntu-latest
steps:
- name: Check Labels
id: labeler
uses: fuxingloh/multi-labeler@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
labeler:
runs-on: ubuntu-latest
steps:
- name: Check Labels
id: labeler
uses: fuxingloh/multi-labeler@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
70 changes: 38 additions & 32 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,48 @@ on:
- master
- main
paths:
- '**'
- '!docs/**'
- '!**.md'
- "**"
- "!docs/**"
- "!**.md"
pull_request:
paths:
- '**'
- '!docs/**'
- '!**.md'
- "**"
- "!docs/**"
- "!**.md"

name: Benchmark
jobs:
Compare:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Fetch Repository
uses: actions/checkout@v3
- name: Run Benchmark
run: set -o pipefail; go test ./... -benchmem -run=^$ -bench . | tee output.txt
- name: Get Previous Benchmark Results
uses: actions/cache@v3
with:
path: ./cache
key: ${{ runner.os }}-benchmark
- name: Save Benchmark Results
uses: benchmark-action/[email protected]
with:
tool: 'go'
output-file-path: output.txt
github-token: ${{ secrets.BENCHMARK_TOKEN }}
benchmark-data-dir-path: 'benchmarks'
fail-on-alert: true
comment-on-alert: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
# Enable Job Summary for PRs - deactivated because of issues
#summary-always: ${{ github.event_name != 'push' && github.event_name != 'workflow_dispatch' }}
auto-push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
save-data-file: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
- name: Fetch Repository
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
# NOTE: Keep this in sync with the version from go.mod
go-version: "1.20.x"

- name: Run Benchmark
run: set -o pipefail; go test ./... -benchmem -run=^$ -bench . | tee output.txt

- name: Get Previous Benchmark Results
uses: actions/cache@v3
with:
path: ./cache
key: ${{ runner.os }}-benchmark

- name: Save Benchmark Results
uses: benchmark-action/[email protected]
with:
tool: "go"
output-file-path: output.txt
github-token: ${{ secrets.BENCHMARK_TOKEN }}
benchmark-data-dir-path: "benchmarks"
fail-on-alert: true
comment-on-alert: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
# Enable Job Summary for PRs - deactivated because of issues
#summary-always: ${{ github.event_name != 'push' && github.event_name != 'workflow_dispatch' }}
auto-push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
save-data-file: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
88 changes: 44 additions & 44 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,57 @@ on:
- master
- main
paths:
- '**'
- '!docs/**'
- '!**.md'
- "**"
- "!docs/**"
- "!**.md"
pull_request:
paths:
- '**'
- '!docs/**'
- '!**.md'
- "**"
- "!docs/**"
- "!**.md"
schedule:
- cron: '0 3 * * 6'
- cron: "0 3 * * 6"

jobs:
analyse:
name: Analyse
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
# Override language selection by uncommenting this and choosing your languages
with:
languages: go

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
# Override language selection by uncommenting this and choosing your languages
with:
languages: go

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
5 changes: 4 additions & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ on:
pull_request:
permissions:
contents: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
# NOTE: Keep this in sync with the version from go.mod
go-version: 1.21.x
go-version: "1.20.x"

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master
- main
push:
# branches to consider in the event; optional, defaults to all
branches:
- master
- main

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
update_release_draft:
runs-on: ubuntu-latest
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV

# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 5 additions & 7 deletions .github/workflows/sync-docs.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: 'Sync docs'
name: "Sync docs"

on:
push:
branches:
- master
- main
paths:
- 'docs/**'
- "docs/**"
release:
types: [ published ]
types: [published]

jobs:
sync-docs:
Expand All @@ -19,13 +19,11 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install JQ
run: sudo apt-get install jq
node-version: "18"

- name: Sync docs
run: ./.github/scripts/sync_docs.sh
Expand Down
39 changes: 21 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ on:
- master
- main
paths:
- '**'
- '!docs/**'
- '!**.md'
- "**"
- "!docs/**"
- "!**.md"
pull_request:
paths:
- '**'
- '!docs/**'
- '!**.md'
- "**"
- "!docs/**"
- "!**.md"

name: Test
jobs:
Build:
Expand All @@ -21,15 +22,17 @@ jobs:
platform: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Fetch Repository
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Run Test
uses: nick-fields/retry@v2
with:
max_attempts: 3
timeout_minutes: 15
command: go test ./... -v -race -count=1
- name: Fetch Repository
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Run Test
uses: nick-fields/retry@v2
with:
max_attempts: 3
timeout_minutes: 15
command: go test ./... -v -race -count=1
Loading

0 comments on commit 7e0ac2a

Please sign in to comment.