Restructure to the standard Module layout with conformance tests (#7) #19
This file contains hidden or 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: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| cache-dependency-path: | | |
| go.sum | |
| - name: Check Go formatting | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| files="$(gofmt -l .)" | |
| if [[ -n "${files}" ]]; then | |
| echo "${files}" | |
| exit 1 | |
| fi | |
| - name: Validate plugin manifest | |
| run: python -m json.tool bomly-plugin.json >/dev/null | |
| - name: Run tests | |
| run: make test | |
| - name: Run go vet | |
| run: go vet ./... | |
| - name: Build plugin | |
| run: make build | |
| - name: Check module metadata drift | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| go mod tidy | |
| git diff --exit-code -- go.mod go.sum |