Skip to content

EREGCSC-2363 -- Prevent frontend from interpreting HTML characters (#… #804

EREGCSC-2363 -- Prevent frontend from interpreting HTML characters (#…

EREGCSC-2363 -- Prevent frontend from interpreting HTML characters (#… #804

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@v5
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