-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathaction.yml
55 lines (49 loc) · 1.69 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: "tuf-conformance"
description: "TUF client conformance test suite"
inputs:
entrypoint:
description: "client-under-test CLI to invoke"
required: true
artifact-name:
description: "Name to use for GitHub artifact upload. The 'entrypoint' will be used by default
but if you call this action in a job matrix, make sure each call gets a unique name"
default: ""
required: false
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.11"
- name: Install test
run: |
echo "::group::Install test suite and dependencies"
sudo apt install faketime
pip install -e "${{ github.action_path }}"
echo "::endgroup::"
shell: bash
- name: Run test suite
id: tuf-conformance
env:
ENTRYPOINT: ${{ inputs.entrypoint }}
TEST_LOCATION: ${{ github.action_path }}/tuf_conformance
NAME: ${{ inputs.artifact-name }}
run: |
# create a sanitized name for the artifact upload
if [[ -z $NAME ]]; then
echo "NAME=test repositories for ${ENTRYPOINT##*/}" >> "$GITHUB_OUTPUT"
else
echo "NAME=$NAME" >> "$GITHUB_OUTPUT"
fi
# run test suite
pytest -v "$TEST_LOCATION" \
--entrypoint "$ENTRYPOINT" \
--repository-dump-dir ./test-repositories \
shell: bash
- name: Upload repository dump
if: ${{ !cancelled() }}
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: ${{ steps.tuf-conformance.outputs.NAME }}
path: test-repositories