-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (62 loc) · 2.51 KB
/
tests.yml
File metadata and controls
75 lines (62 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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.12'
- 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/slack-github-action@v1.24.0
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 }}