Cross compatibility test #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |