-
Notifications
You must be signed in to change notification settings - Fork 81
101 lines (97 loc) · 3.6 KB
/
tuf_client_tests.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# Copyright 2022 The Sigstore Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: TUF Client tests
on:
workflow_dispatch:
push:
paths:
- 'repository/**'
pull_request:
jobs:
client:
runs-on: ubuntu-latest
steps:
# Set up a repository server with python
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: 2
- run: |
cd repository/repository/
python -m http.server 8001 &
echo "REPO=http://localhost:8001" >> $GITHUB_ENV
# Test with go-tuf client
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: './go.mod'
check-latest: true
- run: |
go install github.com/theupdateframework/go-tuf/cmd/tuf-client@v0.7.0
- run: |
# Only 5.root.json is compatible with new versions of go-tuf
if [ -f repository/repository/5.root.json ]; then
tuf-client init http://localhost:8001 repository/repository/5.root.json
tuf-client list http://localhost:8001
fi
# Verify with a go-tuf client that can understand deprecated keys
go run ./tests/client-tests init http://localhost:8001 repository/repository/1.root.json
go run ./tests/client-tests list http://localhost:8001
# Test with rust client
# Re-enable this job once Tough supports updated ecdsa keytypes
# https://github.com/awslabs/tough/issues/754
# - name: Configure cargo cache
# uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319
# with:
# path: |
# /tmp/tuftool-target
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# key: ${{ runner.os }}-cargo-tuftool
# - name: Install tuftool
# run: |
# cargo install tuftool \
# --version "0.10.2" --target-dir /tmp/tuftool-target
# - run: |
# tuftool download out \
# --root repository/repository/2.root.json \
# -t http://localhost:8001/targets \
# -m http://localhost:8001
# Test with python-tuf ngclient
- run: |
python3 -m pip install securesystemslib[crypto,pynacl] tuf
python3 tests/client-tests/python-tuf.py
jsclient:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
with:
node-version: 16
- name: Install tufjs/cli
run: npm install -g @tufjs/cli
- run: |
cd repository/repository/
python -m http.server 8001 &
- name: Download and verify root
run: |
tuf download \
--metadata-base-url http://localhost:8001 \
--root repository/repository/5.root.json \
--target-name trusted_root.json