Skip to content

Update test.yml

Update test.yml #89

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.21.x, 1.22.x, 1.23.x]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version: ${{ matrix.go_version }}
- name: Build
run: go build -v ./...
- name: test
run: go test ./... -race -coverprofile=coverage.txt -covermode=atomic
auto-merge:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- 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}}