Skip to content

[Onboarding] Updates to config files and documentation based on recen… #696

[Onboarding] Updates to config files and documentation based on recen…

[Onboarding] Updates to config files and documentation based on recen… #696

Workflow file for this run

name: Parser Checks
on:
pull_request:
types: [ opened, synchronize, reopened ]
paths:
- 'solution/parser/**'
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
parser-checks:
# The type of runner that the job will run on
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
dir: ["ecfr-parser", "fr-parser", "lib/ecfr", "lib/eregs", "lib/fedreg", "lib/network", "lib/parsexml"]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Setup Go
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '^1.16' # The Go version to download (if necessary) and use.
# set up build cache
- name: Set up build cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/go/bin
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# Run go fmt on the code
- name: Run gofmt
uses: Jerome1337/gofmt-action@v1.0.5
with:
gofmt-path: './solution/parser/${{ matrix.dir }}'
gofmt-flags: '-l -d'
- uses: dominikh/staticcheck-action@v1.3.0
with:
version: "2022.1.3"
working-directory: "./solution/parser/${{ matrix.dir }}"
# Run lint on the code
- name: Run lint
run: |
go install golang.org/x/lint/golint@latest
pushd solution/parser/${{ matrix.dir }}
golint -set_exit_status ./...
popd
# Run tests and create coverage report
- name: Run tests
run: |
pushd solution/parser/${{ matrix.dir }}
go test -cover ./...
popd