Tests should be ran on every Pull Request. This will allow for:
Blocking merges if tests are failing
Will send clear message to contributors and maintainers that there's an issue (and often will hint where it's at)
Tests should be ran only for Pull Requests and not for merges to main branch as PRs are the only way to commit to main.
This could be a starting point for .github/workflows/pr-check.yml file:
name: Test PR
on:
pull_request:
branches:
- main
jobs:
check-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: ???
- name: Run tests
uses: ???
Tests should be ran on every Pull Request. This will allow for:
Tests should be ran only for Pull Requests and not for merges to
main
branch as PRs are the only way to commit tomain
.This could be a starting point for
.github/workflows/pr-check.yml
file: