11# Based on
22# https://github.com/opentdf/java-sdk/blob/v0.6.1/.github/workflows/checks.yaml
3+ #
4+ # Except, that this is a "Composite Action", and specifies 'shell: bash' for
5+ # each 'run:' step.
36name : " Platform Integration testing"
47
58on :
6- pull_request :
7-
8- # on:
9- # pull_request:
10- # branches:
11- # - main
12- # push:
13- # branches:
14- # - main
9+ workflow_call :
10+ inputs :
11+ wheel :
12+ description : The Python wheel to test
13+ required : true
14+ type : string
1515
1616permissions :
1717 contents : read
1818
1919jobs :
20-
21- platform-integration :
22- runs-on : ubuntu-22.04
20+ integration_test :
21+ runs-on : ubuntu-latest
2322 steps :
24- - name : Checkout Java SDK
23+ - name : Checkout this repo
2524 uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
26- - uses : bufbuild/buf-setup-action@382440cdb8ec7bc25a68d7b4711163d95f7cc3aa
25+
26+ - uses : actions/cache/restore@v4
2727 with :
28- github_token : ${{ secrets.GITHUB_TOKEN }}
28+ path : dist/otdf_python-0.1.0-py3-none-any.whl
29+ key : ${{ runner.os }}-data-${{ github.sha }}
30+
31+ - name : Prove that the input file is available
32+ shell : bash
33+ run : |
34+ ls -la
35+ ls -la "${{ inputs.wheel }}"
36+ du -sh "${{ inputs.wheel }}"
37+
38+ # - uses: bufbuild/buf-setup-action@382440cdb8ec7bc25a68d7b4711163d95f7cc3aa
39+ # with:
40+ # github_token: ${{ secrets.GITHUB_TOKEN }}
2941
3042 - name : Check out platform
3143 uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
@@ -44,10 +56,13 @@ jobs:
4456 platform/protocol/go/go.sum
4557 platform/sdk/go.sum
4658 - run : go mod download
59+ shell : bash
4760 working-directory : platform
4861 - run : go mod verify
62+ shell : bash
4963 working-directory : platform
5064 - name : Create keys
65+ shell : bash
5166 run : |
5267 .github/scripts/init-temp-keys.sh
5368 cp opentdf-dev.yaml opentdf.yaml
@@ -64,12 +79,15 @@ jobs:
6479 # -alias localhost-for-tests
6580 # working-directory: platform/keys
6681 - name : Bring the services up
82+ shell : bash
6783 run : docker compose up -d --wait --wait-timeout 240
6884 working-directory : platform
6985 - name : Provision keycloak
86+ shell : bash
7087 run : go run ./service provision keycloak
7188 working-directory : platform
7289 - name : Provision fixtures
90+ shell : bash
7391 run : go run ./service provision fixtures
7492 working-directory : platform
7593 - name : Start server in background
@@ -83,12 +101,37 @@ jobs:
83101 wait-for : 90s
84102 working-directory : platform
85103 - name : Get grpcurl
104+ shell : bash
86105 run :
go install github.com/fullstorydev/grpcurl/cmd/[email protected] 87106 - name : Make sure that the platform is up
107+ shell : bash
88108 run : |
89109 grpcurl -plaintext localhost:8080 list && \
90110 grpcurl -plaintext localhost:8080 kas.AccessService/PublicKey
91111
112+ - name : Set up Python
113+ uses : actions/setup-python@v4
114+ with :
115+ python-version : ' 3.11'
116+
117+ - name : Validate the Python SDK
118+ env :
119+ OPENTDF_CLIENT_ID : " opentdf-sdk"
120+ OPENTDF_CLIENT_SECRET : " secret"
121+ OPENTDF_HOSTNAME : " localhost:8080"
122+ OIDC_TOKEN_ENDPOINT : " http://localhost:8888/auth/realms/opentdf/protocol/openid-connect/token"
123+ OPENTDF_KAS_URL : " http://localhost:8080/kas"
124+ run : |
125+ mkdir validation
126+ wheel="$(basename ${{ inputs.wheel }} )"
127+ cp -v "${{ inputs.wheel }}" validation/
128+ cp -v validate_otdf_python.py validation/
129+ cd validation
130+ python -m venv .venv
131+ source .venv/bin/activate
132+ pip install ./"$wheel"
133+ python validate_otdf_python.py
134+
92135 # - name: Validate the SDK through the command line interface
93136 # run: |
94137 # printf 'here is some data to encrypt' > data
0 commit comments