Clean up generated files before regenerating (#168) #266
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: ci | |
on: | |
push: | |
branches: [ 'main' ] | |
pull_request: | |
branches: [ '**' ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 | |
- name: Set up go | |
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 | |
with: | |
go-version: 1.18 | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
run: go test -v ./... | |
- name: FuzzTest | |
run: go test -fuzz=./... -fuzztime=3s | |
check-regen: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 | |
- name: Set up go | |
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 | |
with: | |
go-version: 1.18 | |
- name: Check regenerated files | |
run: | | |
make regen | |
readonly changed_files="$(git diff --stat)" | |
if [[ "${changed_files}" != "" ]]; then | |
echo "Found diffs after running 'make regen'" | |
echo "Please run 'make regen' & commit the changed files:" | |
echo "${changed_files}" | |
exit 1 | |
fi | |
check-readme-format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.head_ref }} | |
persist-credentials: false | |
- name: Ensure the readme is formatted (make format-readme) | |
uses: creyD/prettier_action@v4.3 # TSCCR: no entry for repository "creyD/prettier_action" | |
with: | |
dry: True | |
prettier_options: --write README.md | |