Execute tests against AWS #133
This file contains hidden or 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: Execute tests against AWS | |
| on: | |
| schedule: | |
| - cron: '00 6 * * 0' | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: "The branch, tag or SHA to checkout, e.g. refs/pull/<pr_number>/merge" | |
| required: true | |
| type: string | |
| tests_specifier: | |
| default: "tests" | |
| description: "pytest test(s) specifier" | |
| required: false | |
| type: string | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| name: "Test Against AWS" | |
| if: ${{ github.repository == 'getmoto/moto' }} | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Set git ref for `workflow_dispatch` event | |
| if: github.event_name == 'workflow_dispatch' | |
| run: echo "GITHUB_REF=${{ inputs.ref }}" >> $GITHUB_ENV | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ env.GITHUB_REF }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Get pip cache dir | |
| id: pip-cache | |
| run: | | |
| echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT | |
| - name: pip cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ steps.pip-cache.outputs.dir }} | |
| key: pip-3.11-${{ hashFiles('**/setup.cfg') }} | |
| - name: Update pip | |
| run: | | |
| python -m pip install --upgrade pip | |
| - name: Install project dependencies | |
| run: | | |
| pip install -r requirements-dev.txt | |
| - name: Configure AWS | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| aws-region: us-east-1 | |
| role-to-assume: arn:aws:iam::682283128318:role/GithubActionsRole | |
| role-duration-seconds: 7200 | |
| - name: Test with pytest | |
| env: | |
| MOTO_TEST_ALLOW_AWS_REQUEST: ${{ true }} | |
| TESTS_SPECIFIER: ${{ github.event_name == 'workflow_dispatch' && inputs.tests_specifier || 'tests' }} | |
| run: | | |
| pytest -sv -n auto --dist loadfile ${{ env.TESTS_SPECIFIER }} -m aws_verified --durations 100 | |