-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (55 loc) · 1.64 KB
/
test.yaml
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
name: Cross compatibility test
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * 1'
jobs:
test:
strategy:
fail-fast: false
matrix:
runner: [ubuntu-latest, windows-latest]
in_toto_go: ['latest', 'HEAD']
in_toto_python: ['latest', 'HEAD']
runs-on: ${{matrix.runner}}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup up Go
uses: actions/setup-go@v4
with:
go-version: '1.19.x'
- name: Install latest in-toto-python version
run: |
if [ "${{ matrix.in_toto_python }}" == "latest" ]
then
python -m pip install in-toto
elif [ "${{ matrix.in_toto_python }}" == "HEAD" ]
then
python -m pip install git+https://github.com/in-toto/in-toto.git
else
python -m pip install git+https://github.com/in-toto/in-toto.git@${{ matrix.in_toto_python }}
fi
shell: bash
- name: Install in-toto-golang
run: go install github.com/in-toto/in-toto-golang@${{matrix.in_toto_go}}
- name: Run tests
run: python -m unittest
docker-test:
name: Test using docker container
runs-on: ubuntu-latest
permissions:
packages: read
env:
DOCKER_IMAGE: ghcr.io/pradyumnakrishna/in-toto-testing:latest
steps:
- name: Pull latest docker image
run: docker pull ${{ env.DOCKER_IMAGE }}
- name: Run tests
run: docker run ${{ env.DOCKER_IMAGE }}