Skip to content

fix(api)!: use root path for prefixing #310

fix(api)!: use root path for prefixing

fix(api)!: use root path for prefixing #310

Workflow file for this run

name: Pull Request - Lint and Test Workflow
on: [pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- uses: actions/cache@v3
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@v2
- uses: CondeNast/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# if the PR contains a single commit, fail if the commit message and the PR title do not match
commitTitleMatch: "true"
ignoreCommits: "true"
test:
needs: [lint, lint-conventional-pr]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- uses: actions/cache@v3
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: 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: Ingest Stac Items/Collection
run: |
./scripts/load-data-container.sh
- name: Sleep for 10 seconds
run: sleep 10s
shell: bash
- name: Integrations tests
run: python -m pytest .github/workflows/tests/ -vv -s
- name: Stop services
run: docker compose stop
predeploy:
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 17
- name: Configure awscli
uses: aws-actions/configure-aws-credentials@v1
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@v3
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@v3
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 }}" == "main" ]; then
./scripts/get-env.sh "veda-backend-uah-staging-env"
elif [ "${{ 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