tests #75
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: tests | |
| permissions: | |
| id-token: write # required for requesting the JWT | |
| contents: read # required for actions/checkout | |
| on: | |
| # Uncomment below for running it manually on the github UI | |
| workflow_dispatch: | |
| # Uncomment below for running it on a push in a specific branch | |
| # push: | |
| # branches: | |
| # - "change-stac-api-url-stage" | |
| # Uncomment below for running it as a cron job | |
| # schedule: | |
| # - cron: '15 16 * * 5' | |
| jobs: | |
| python-job: | |
| name: "PyTest tests" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - environment: test | |
| - environment: dev | |
| environment: ${{ matrix.environment }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: '3.11.4' | |
| - name: Assume Github OIDC role | |
| uses: aws-actions/configure-aws-credentials@v2 | |
| with: | |
| aws-region: us-west-2 | |
| role-to-assume: ${{ vars.MAAP_EOAPI_TEST_ROLE }} | |
| role-session-name: maap-eoapi-tests-${{ matrix.environment }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r tests/requirements.txt | |
| - name: Run pytest | |
| env: | |
| INGESTOR_DOMAIN_NAME: ${{ vars.INGESTOR_DOMAIN_NAME }} | |
| STAC_API_CUSTOM_DOMAIN_NAME: ${{ vars.STAC_API_CUSTOM_DOMAIN_NAME }} | |
| TITILER_PGSTAC_API_CUSTOM_DOMAIN_NAME: ${{ vars.TITILER_PGSTAC_API_CUSTOM_DOMAIN_NAME }} | |
| SECRET_ID: ${{ vars.SECRET_ID }} | |
| run: | | |
| pytest tests | |
| - name: slack | |
| if: always() | |
| id: slack | |
| uses: slackapi/[email protected] | |
| with: | |
| # Slack channel id, channel name, or user id to post message. | |
| # See also: https://api.slack.com/methods/chat.postMessage#channels | |
| # You can pass in multiple channels to post to by providing a comma-delimited list of channel IDs. | |
| channel-id: ${{ vars.SLACK_CHANNEL_ID }} | |
| # For posting a simple plain text message | |
| slack-message: "GitHub build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | |
| env: | |
| SLACK_BOT_TOKEN: ${{ vars.SLACK_BOT_TOKEN }} | |