|
| 1 | +# This workflow runs integration tests with AWS KMS keys |
| 2 | +name: integration-tests |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [ master ] |
| 7 | + pull_request: |
| 8 | + branches: [ master ] |
| 9 | + # Run once a day |
| 10 | + schedule: |
| 11 | + - cron: '0 0 * * *' |
| 12 | + |
| 13 | +jobs: |
| 14 | + test: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] |
| 20 | + include: |
| 21 | + - python-version: '3.8' |
| 22 | + toxenv: 'py38-integ-slow' |
| 23 | + - python-version: '3.9' |
| 24 | + toxenv: 'py39-integ-slow' |
| 25 | + - python-version: '3.10' |
| 26 | + toxenv: 'py310-integ-slow' |
| 27 | + - python-version: '3.11' |
| 28 | + toxenv: 'py311-integ-slow' |
| 29 | + - python-version: '3.12' |
| 30 | + toxenv: 'py312-integ-slow' |
| 31 | + permissions: |
| 32 | + id-token: write |
| 33 | + contents: read |
| 34 | + |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + |
| 38 | + - name: Set up Python ${{ matrix.python-version }} |
| 39 | + uses: actions/setup-python@v5 |
| 40 | + with: |
| 41 | + python-version: ${{ matrix.python-version }} |
| 42 | + |
| 43 | + - name: Install dependencies |
| 44 | + run: | |
| 45 | + python -m pip install --upgrade pip |
| 46 | + pip install "tox < 4.0" |
| 47 | + |
| 48 | + # Python no longer bundles setuptools starting in 3.12 |
| 49 | + - name: Install python version specific dependencies |
| 50 | + if: matrix.python-version == '3.12' |
| 51 | + run: | |
| 52 | + pip install setuptools |
| 53 | + |
| 54 | + - name: Configure AWS Credentials for Tests |
| 55 | + uses: aws-actions/configure-aws-credentials@v4 |
| 56 | + with: |
| 57 | + aws-region: us-west-2 |
| 58 | + role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Python-Role-us-west-2 |
| 59 | + role-session-name: DDBEC-Python-Tests |
| 60 | + |
| 61 | + - name: Test with tox |
| 62 | + env: |
| 63 | + TOXENV: ${{ matrix.toxenv }} |
| 64 | + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- |
| 65 | + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f |
| 66 | + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- |
| 67 | + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 |
| 68 | + run: tox |
| 69 | + |
| 70 | + coverage: |
| 71 | + runs-on: ubuntu-latest |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@v4 |
| 74 | + |
| 75 | + - name: Set up Python |
| 76 | + uses: actions/setup-python@v5 |
| 77 | + with: |
| 78 | + python-version: '3.x' |
| 79 | + |
| 80 | + - name: Install dependencies |
| 81 | + run: | |
| 82 | + python -m pip install --upgrade pip |
| 83 | + pip install "tox < 4.0" |
| 84 | + pip install setuptools |
| 85 | + |
| 86 | + - name: Run coverage |
| 87 | + env: |
| 88 | + TOXENV: coverage |
| 89 | + run: tox |
0 commit comments