Skip to content

Bump get-func-name from 2.0.0 to 2.0.2 #10250

Bump get-func-name from 2.0.0 to 2.0.2

Bump get-func-name from 2.0.0 to 2.0.2 #10250

Workflow file for this run

name: PR
on:
pull_request:
branches:
- "main"
- "branch-v*"
- "bug-fix-*"
- "feature-*"
concurrency:
group: '${{ github.head_ref }}'
cancel-in-progress: true
jobs:
python-dependencies:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: |
echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pipenv'
- name: Install Pipenv
run: pip install pipenv==2023.8.22
- name: Install virtual environment
run: |
sudo apt-get install libsnappy-dev
pipenv install --dev
node-dependencies:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.14.0"
- name: Get yarn cache
id: get-yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache yarn modules
id: cache-yarn
uses: actions/cache@v3
with:
path: ${{ steps.get-yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: Install yarn deps
if: steps.cache-yarn.outputs.cache-hit != 'true'
run: yarn
lint:
needs: [python-dependencies, node-dependencies]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: |
echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pipenv'
- uses: actions/setup-node@v3
with:
node-version: "18.14.0"
- name: Write app version
run: printf "${{ github.event.pull_request.head.sha }}" > .application-version
- name: Install pipenv
run: pip install pipenv==2023.8.22
- name: Install virtual environment
run: pipenv install --dev
- name: Compile translations
run: make translate
- name: Running translation tests
run: pipenv run python -m scripts.extract_translation_templates --test
- name: Python linting
run: pipenv run ./scripts/run_lint_python.sh
- name: Get yarn cache
id: get-yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache yarn modules
uses: actions/cache@v3
id: cache-yarn
with:
path: ${{ steps.get-yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: Install yarn deps
run: yarn install
- name: Functional tests spec lint
run: ./scripts/lint_functional_test_specs.sh
- name: Javascript linting
run: yarn lint
test-unit:
needs: python-dependencies
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: |
echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pipenv'
- name: Install apt dependencies
run: |
sudo apt-get install libsnappy-dev libgconf-2-4 jq
# Install wkthtmltopdf with patched Qt
sudo apt-get install -y xfonts-base xfonts-75dpi
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb
- name: Write app version
run: printf "${{ github.event.pull_request.head.sha }}" > .application-version
- name: Install pipenv
run: pip install pipenv==2023.8.22
- name: Install virtual environment
run: pipenv install --dev
- name: Load templates
run: make load-design-system-templates
- name: Compile translations
run: make translate
- name: Link env vars
run: ln -sf .development.env .env
- name: Running unit tests
run: pipenv run ./scripts/run_tests_unit.sh
validate-schemas:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Run validator
run: ./scripts/run_validator.sh
- name: Running schema tests
run: ./scripts/validate_test_schemas.sh
test-functional:
needs: [python-dependencies, node-dependencies]
strategy:
matrix:
suite: [ timeout_modal_expired, timeout_modal_extended, timeout_modal_extended_new_window, features, general, components ]
runs-on: ubuntu-22.04
env:
EQ_RUN_FUNCTIONAL_TESTS_HEADLESS: True
# :TODO: Revisit & update when 2 instances can be used without adverse effects
EQ_FUNCTIONAL_TEST_MAX_INSTANCES: 1
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.14.0"
- run: |
echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pipenv'
- name: Install pipenv
run: pip install pipenv==2023.8.22
- name: Install virtual environment
run: pipenv install --dev
- name: Get yarn cache
id: get-yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache yarn modules
uses: actions/cache@v3
id: cache-yarn
with:
path: ${{ steps.get-yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: Install yarn deps
run: yarn install
- name: Docker compose
run: docker-compose --version && RUNNER_ENV_FILE=.functional-tests.env docker-compose up --build -d
- name: Functional tests
run: ./scripts/run_tests_functional.sh ${{ matrix.suite }}
- name: Docker compose shutdown
run: RUNNER_ENV_FILE=.functional-tests.env docker-compose kill
docker-push:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set Tag and SHA
run: |
CLEAN_TAG=$(echo "${{ github.event.pull_request.head.ref }}" | tr / -)
echo "TAG=$CLEAN_TAG" >> $GITHUB_ENV
echo "SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
- name: Write app version
run: |
echo "Writing SHA $SHA to .application_version"
printf $SHA > .application-version
- name: Build
run: >
docker build -t onsdigital/eq-questionnaire-runner:$TAG
-t ${{ secrets.GAR_LOCATION }}/${{ secrets.GAR_PROJECT_ID }}/docker-images/eq-questionnaire-runner:$TAG .
- name: Push to Docker Hub
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
echo "Pushing to DockerHub with tag $TAG"
docker push onsdigital/eq-questionnaire-runner:$TAG
- name: Push to GAR
env:
GAR_SERVICE_KEY: ${{ secrets.GAR_SERVICE_KEY }}
run: |
echo $GAR_SERVICE_KEY | docker login -u _json_key --password-stdin https://${{ secrets.GAR_LOCATION }}
gcloud auth configure-docker ${{ secrets.GAR_LOCATION }}
echo "Pushing to GAR with tag $TAG"
docker push ${{ secrets.GAR_LOCATION }}/${{ secrets.GAR_PROJECT_ID }}/docker-images/eq-questionnaire-runner:$TAG