Skip to content

Populate domains drop down with what's been ingested in datahub #457

Populate domains drop down with what's been ingested in datahub

Populate domains drop down with what's been ingested in datahub #457

Workflow file for this run

name: test
# based on https://jacobian.org/til/github-actions-poetry/
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11.1
- name: cache poetry install
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-1.7.1-0
- uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: cache deps
id: cache-deps
uses: actions/cache@v4
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}
- run: poetry install --no-interaction --no-root
if: steps.cache-deps.outputs.cache-hit != 'true'
- run: poetry install --no-interaction
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "21"
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
id: install_dependencies
run: npm install
- name: collect static files
run: poetry run python manage.py collectstatic --no-input
- name: run unit tests with coverage
id: fast-tests
run: poetry run pytest --cov -m 'not slow and not datahub' --doctest-modules
- name: Prepare Selenium
# https://github.com/marketplace/actions/setup-chromedriver
uses: nanasess/[email protected]
- name: run selenium tests
id: slow-tests
if: steps.fast-tests.outcome == 'success'
run: poetry run pytest tests/selenium --axe-version 4.9.0
javascript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "21"
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
id: install_dependencies
run: npm install
- name: Run javascript tests
run: npm test
# Deploys to the 'dev' frontend unless pushed to main
deploy-to-dev:
if: github.event.ref != 'refs/heads/main'
uses: "./.github/workflows/deploy-generic.yml"
with:
env: "dev"
ecr_repository: ${{ vars.DEV_ECR_REPOSITORY }}
ecr_region: ${{ vars.DEV_ECR_REGION }}
secrets:
kube_namespace: ${{ secrets.KUBE_NAMESPACE }}
kube_cert: ${{ secrets.KUBE_CERT }}
kube_cluster: ${{ secrets.KUBE_CLUSTER }}
kube_token: ${{ secrets.KUBE_TOKEN }}
ecr_role_to_assume: ${{ secrets.DEV_ECR_ROLE_TO_ASSUME }}
secret_key: ${{ secrets.SECRET_KEY }}
catalogue_token: ${{ secrets.CATALOGUE_TOKEN }}
slack_alert_webhook: ${{ secrets.SLACK_ALERT_WEBHOOK }}
azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }}