Skip to content

Trying new test workflow deployment #219

Trying new test workflow deployment

Trying new test workflow deployment #219

Workflow file for this run

name: test
# based on https://jacobian.org/til/github-actions-poetry/
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
unit_test:
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: run unit tests with coverage
id: fast-tests
run: poetry run pytest --cov -m 'not slow'
- name: Get Chromium version 🌐
run: |
CHROMIUM_VERSION=$(google-chrome --product-version)
echo "Chromium version: $CHROMIUM_VERSION"
echo "CHROMIUM_VERSION=$CHROMIUM_VERSION" >> $GITHUB_ENV
- name: Install chromedriver 🚗
run: |
npm install -g chromedriver@${CHROMIUM_VERSION%.*.*}
- name: run selenium tests
id: slow-tests
if: steps.fast-tests.outcome == 'success'
run: poetry run pytest -m 'slow' --chromedriver-path=$(npm root -g)/chromedriver/bin/chromedriver
javascript_test:
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
deploy_test:
uses: "./.github/workflows/deploy-generic.yml"

Check failure on line 86 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / test

Invalid workflow file

The workflow is not valid. .github/workflows/test.yml (Line: 86, Col: 11): Input debug_flag is required, but not provided while calling. .github/workflows/test.yml (Line: 91, Col: 14): Invalid input, debug is not defined in the referenced workflow.
with:
env: "test"
ecr_repository: "${{ vars.TEST_ECR_REPOSITORY }}"
ecr_region: "${{ vars.TEST_ECR_REGION }}"
debug: "${{ vars.DEBUG }}"
django_allowed_hosts: "${{ vars.DJANGO_ALLOWED_HOSTS }}"
catalogue_url: "${{ vars.CATALOGUE_URL }}"
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.TEST_ECR_ROLE_TO_ASSUME }}"
secret_key: "${{ secrets.SECRET_KEY }}"
catalogue_token: "${{ secrets.CATALOGUE_TOKEN }}"