Files
slsa-verifier/.github/workflows/pre-submit.cli.yml
2022-10-31 18:13:42 +00:00

50 lines
1.2 KiB
YAML

name: Pre submits cli
on:
pull_request:
branches: [ "main" ]
workflow_dispatch:
# Used in combination with schedule.cli.yml
# to avoid duplicating the test code.
schedule:
- cron: '25 6 * * 5'
permissions: read-all
jobs:
pre-submit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.1.2
- name: setup-go
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # tag=v3.3.1
with:
go-version: '1.18'
- name: Save event name
env:
EVENT_NAME: ${{ github.event_name }}
run: |
echo "$EVENT_NAME" > ./event_name.txt
- uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # tag=v3.1.1
with:
name: event_name
path: ./event_name.txt
- name: Run tests for verifier
run: |
set -euo pipefail
go mod vendor
# Build cli
go build -mod=vendor -o slsa-verifier ./cli/slsa-verifier/
# Builder service
go build -mod=vendor -o service ./cli/experimental/service/
# Tests
go test -mod=vendor -v ./...