name: Test permissions: contents: read on: push: branches: - main pull_request: null jobs: test: strategy: matrix: go-version: [1.20.x] platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} steps: - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: go-version: ${{ matrix.go-version }} - name: set env vars run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab with: fetch-depth: 0 - name: cache go binaries uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 id: cache-go-bin with: path: ~/go/bin key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }} restore-keys: ${{ runner.os }}-go-bin - name: Lint run: make lint - name: test run: make test precommit: runs-on: ubuntu-latest if: github.event_name == 'pull_request' steps: - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab with: fetch-depth: 0 - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: go-version: 1.20.x - uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b with: python-version: "3.x" - uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 with: extra_args: --show-diff-on-failure --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }} env: SKIP: lint license: runs-on: ubuntu-latest needs: - test steps: - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: go-version: 1.20.x - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - name: FOSSA Scan uses: fossa-contrib/fossa-action@6728dc6fe9a068c648d080c33829ffbe56565023 with: fossa-api-key: 18f4ef488f514d06874b75f5809cea93