Skip to content

. e Bump actions/checkout from 5 to 6 #219

. e Bump actions/checkout from 5 to 6

. e Bump actions/checkout from 5 to 6 #219

Workflow file for this run

name: Build and Test
on:
push:
pull_request:
repository_dispatch:
schedule:
- cron: '05 5 1 * *' # <https://crontab.guru/#05_5_1_*_*> - "At 05:05 on day-of-month 1"
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
go-version:
- 1.18.x
- 1.19.x
- 1.20.x
- 1.21.x
- 1.22.x
- 1.23.x
- 1.24.x
- 'stable'
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: go build -v ./...
- name: Install
run: go install github.com/jstemmer/go-junit-report/v2@latest
- name: test
run: |
mkdir test-reports
go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic | go-junit-report -set-exit-code > test-reports/test-results.xml
- name: Publish Test Report
uses: mikepenz/action-junit-report@v6
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/test-reports/*.xml'
auto-merge:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v6
- name: auto-merge
if: |
github.actor == 'dependabot[bot]' &&
github.event_name == 'pull_request'
run: |
gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
# this secret needs to be in the settings.secrets.dependabot
GITHUB_TOKEN: ${{secrets.GH_ACTION_TOKEN}}