mirror of
https://github.com/slsa-framework/slsa-verifier.git
synced 2026-08-18 19:18:16 +00:00
feat: run CLI tests daily (#327)
* update * update * update * update * update
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
name: Pre submits
|
||||
on: [pull_request, workflow_dispatch]
|
||||
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
|
||||
|
||||
@@ -15,6 +22,17 @@ jobs:
|
||||
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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: Lint
|
||||
name: Pre submits Lint
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
name: Schedule cli
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Pre submits cli"]
|
||||
types: [completed]
|
||||
branches: [main]
|
||||
|
||||
permissions: read-all
|
||||
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.CREATE_ISSUES }}
|
||||
ISSUE_REPOSITORY: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
if-failed:
|
||||
runs-on: ubuntu-latest
|
||||
# See https://github.com/orgs/community/discussions/26238.
|
||||
steps:
|
||||
- uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # tag=v1.10.0
|
||||
with:
|
||||
name: event_name
|
||||
- name: Check event name
|
||||
id: name
|
||||
run: |
|
||||
name=$(cat ./event_name.txt)
|
||||
ctned="false"
|
||||
if [[ "$name" == "schedule" ]] || [[ "$name" == "workflow_dispatch" ]]; then
|
||||
ctned="true"
|
||||
fi
|
||||
echo "continue=$ctned" >> $GITHUB_OUTPUT
|
||||
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # tag=v2.4.0
|
||||
if: steps.name.outputs.continue == 'true'
|
||||
with:
|
||||
ref: main
|
||||
repository: slsa-framework/example-package
|
||||
- run: ./.github/workflows/scripts/e2e-report-failure.sh
|
||||
if: steps.name.outputs.continue == 'true' && github.event.workflow_run.conclusion != 'success'
|
||||
- run: ./.github/workflows/scripts/e2e-report-success.sh
|
||||
if: steps.name.outputs.continue == 'true' && github.event.workflow_run.conclusion == 'success'
|
||||
Reference in New Issue
Block a user