feat(stac)!: experimenting with stac auth proxy configure_app #1033
Workflow file for this run
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: Pull Request - Lint and Test Workflow | |
| on: [pull_request] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 | |
| with: | |
| python-version: '3.12' | |
| - uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 | |
| with: | |
| path: ${{ env.pythonLocation }} | |
| key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} | |
| - name: Install python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e .[dev,deploy,test] | |
| - name: Run pre-commit | |
| run: pre-commit run --all-files | |
| lint-conventional-pr: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 #v5.5.3 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| test: | |
| needs: [lint, lint-conventional-pr] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Launch services | |
| run: | | |
| AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}} | |
| docker compose up --build -d | |
| - name: Set up Python | |
| uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 | |
| with: | |
| python-version: '3.12' | |
| - uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 | |
| with: | |
| path: ${{ env.pythonLocation }} | |
| key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} | |
| - name: Install python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e .[dev,deploy,test] | |
| - name: Wait for STAC API to be ready | |
| run: | | |
| echo "Waiting for STAC API to be available at localhost:8081..." | |
| timeout 120 bash -c 'until curl -f http://localhost:8081/api/stac/_mgmt/ping 2>/dev/null; do sleep 0.25; done' | |
| echo "STAC API is ready!" | |
| - name: Integrations tests | |
| run: python -m pytest .github/workflows/tests/ -vv -s | |
| - name: Install reqs for ingest api | |
| run: python -m pip install -r ingest_api/runtime/requirements_dev.txt | |
| - name: Install reqs for stac api | |
| run: python -m pip install stac_api/runtime/ | |
| - name: Ingest unit tests | |
| run: NO_PYDANTIC_SSM_SETTINGS=1 python -m pytest ingest_api/runtime/tests/ -vv -s | |
| - name: Stac-api extensions unit tests | |
| run: python -m pytest stac_api/runtime/tests/ --asyncio-mode=auto -vv -s | |
| - name: Stop services | |
| run: docker compose stop | |
| predeploy: | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 | |
| with: | |
| python-version: '3.12' | |
| - name: Setup Node | |
| uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e4 #v4.3.0 | |
| with: | |
| node-version: 20 | |
| - name: Configure awscli | |
| uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 #v4.1.0 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-west-2 | |
| - uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
| - name: Install CDK | |
| run: npm install -g aws-cdk@2 | |
| - uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 | |
| with: | |
| path: ${{ env.pythonLocation }} | |
| key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} | |
| - name: Install python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e .[dev,deploy,test] | |
| - name: Get environment configuration for target branch | |
| run: | | |
| if [ "${{ github.base_ref }}" == "develop" ]; then | |
| ./scripts/get-env.sh "veda-backend-uah-dev-env" | |
| else | |
| echo "No environment associated with ${GITHUB_REF##*/} branch. Test changes against dev stack" | |
| ./scripts/get-env.sh "veda-backend-uah-dev-env" | |
| fi | |
| - name: Pre deployment CDK diff | |
| run: | | |
| echo $STAGE | |
| cdk diff -v --outputs-file ${HOME}/cdk-outputs.json |