jar: skip corrupt jar files #3917
Workflow file for this run
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: | |
config: | |
runs-on: ubuntu-latest | |
outputs: | |
go_versions: ${{ steps.config.outputs.go_versions }} | |
steps: | |
- id: config | |
run: | | |
echo 'go_versions=["1.21","1.20","1.19"]' >> $GITHUB_OUTPUT | |
gating-lints: | |
needs: ['config'] | |
name: Gating Lints | |
runs-on: ubuntu-latest | |
steps: | |
- name: Commit Check | |
uses: gsactions/commit-message-checker@v2 | |
with: | |
pattern: | | |
^(.*):\s*(.*)\n.*$ | |
error: 'Commit must begin with <scope>: <subject>' | |
flags: 'gm' | |
excludeTitle: true | |
excludeDescription: true | |
checkAllCommitMessages: true | |
accessToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Check Filenames | |
if: success() || failure() | |
run: | # Check for all the characters Windows hates. | |
git ls-files -- ':/:*[<>:"|?*]*' | while read -r file; do | |
printf '::error file=%s,title=Bad Filename::Disallowed character in file name\n' "$file" | |
done | |
exit $(git ls-files -- ':/:*[<>:"|?*]*' | wc -l) | |
- name: Setup Go | |
if: success() || failure() | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ fromJSON(needs.config.outputs.go_versions)[0] }} | |
- name: Go Tidy | |
if: success() || failure() | |
run: | | |
trap 'echo "::error file=go.mod,title=Tidy Check::Commit would leave go.mod untidy"' ERR | |
go mod tidy | |
git diff --exit-code | |
build-documentation: | |
name: Build Docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup mdBook | |
uses: peaceiris/actions-mdbook@v1 | |
with: | |
mdbook-version: '0.3.5' | |
- name: mdBook Build | |
run: mdbook build | |
tests: | |
needs: ['config'] | |
name: Tests | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
go: ${{ fromJSON(needs.config.outputs.go_versions) }} | |
steps: | |
- name: Check for Previous Run | |
id: previous | |
uses: actions/cache@v3 | |
with: | |
path: ~/ok-by-run | |
key: commit-ok-${{ matrix.go }}-${{ github.sha }} | |
- name: Checkout | |
if: steps.previous.outputs.cache-hit != 'true' | |
uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
if: steps.previous.outputs.cache-hit != 'true' | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Cache Integration Assets | |
if: steps.previous.outputs.cache-hit != 'true' | |
uses: actions/cache@v3 | |
with: | |
key: integration-assets-${{ hashFiles('**/*_test.go') }} | |
restore-keys: | | |
integration-assets- | |
path: | | |
~/.cache/clair-testing | |
- name: Tests | |
run: | | |
if test -f ~/ok-by-run; then | |
echo "::notice title=Commit Previously Passed::See $(cat ~/ok-by-run) (cache key 'commit-ok-${{ matrix.go }}-${{ github.sha }}')" | |
exit 0 | |
fi | |
printf '%s/%s/actions/runs/%s/attempts/%s\n'\ | |
"${GITHUB_SERVER_URL}" "${GITHUB_REPOSITORY}" "${GITHUB_RUN_ID}" "${GITHUB_RUN_ATTEMPT}"\ | |
> ~/ok-by-run | |
find . -name .git -prune -o -name testdata -prune -o -name go.mod -printf '%h\n' | | |
while read -r dir; do ( | |
cd "$dir" | |
go list -m | |
go mod download | |
go test -race ${RUNNER_DEBUG:+-v} "-coverprofile=${{ runner.temp }}/$(go list -m | tr / _).codecov.out" -covermode=atomic ./... | |
); done | |
- name: Codecov | |
if: >- | |
steps.previous.outputs.cache-hit != 'true' && | |
success() && | |
fromJSON(needs.config.outputs.go_versions)[0] == matrix.go | |
uses: codecov/codecov-action@v3 | |
with: | |
directory: ${{ runner.temp }} | |
override_branch: ${{ github.ref_name }} | |
- name: Database Logs | |
if: failure() || env.RUNNER_DEBUG == 1 | |
run: | | |
sudo -u postgres psql -c 'SELECT version();' | |
sudo journalctl --unit postgresql.service --boot -0 | |
ls /var/log/postgresql/postgresql-*.log | |
sudo cat /var/log/postgresql/postgresql-*.log |