Skip to content

Improve explorer layouting #5183

Improve explorer layouting

Improve explorer layouting #5183

Workflow file for this run

name: Tests
on:
pull_request:
branches: ['*']
permissions:
contents: read
env:
POETRY_VERSION: '2.2.1'
jobs:
environment:
name: Setup test environment
runs-on: ubuntu-latest
outputs:
POSTGRES_PASSWORD: ${{ steps.out.outputs.POSTGRES_PASSWORD }}
POSTGRES_USER: ${{ steps.out.outputs.POSTGRES_USER }}
POSTGRES_DB: ${{ steps.out.outputs.POSTGRES_DB }}
POSTGRES_PORT: ${{ steps.out.outputs.POSTGRES_PORT }}
POSTGRES_SERVER: ${{ steps.out.outputs.POSTGRES_SERVER }}
steps:
- name: Checkout github repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set test environment variables as outputs
id: out
working-directory: ./backend
run: cat .test.env >> $GITHUB_OUTPUT
test:
name: Run backend tests
runs-on: ubuntu-latest
needs: [environment]
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: ${{ needs.environment.outputs.POSTGRES_PASSWORD }}
POSTGRES_PORT: ${{ needs.environment.outputs.POSTGRES_PORT }}
POSTGRES_SERVER: ${{ needs.environment.outputs.POSTGRES_SERVER }}
POSTGRES_DB: ${{ needs.environment.outputs.POSTGRES_DB }}
POSTGRES_USER: ${{ needs.environment.outputs.POSTGRES_USER }}
options: >-
--health-cmd pg_isready
--health-interval 2s
--health-timeout 2s
--health-retries 25
ports:
- ${{ needs.environment.outputs.POSTGRES_PORT }}:5432
steps:
- name: Checkout github repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
- name: Setup Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
cache: 'poetry'
cache-dependency-path: 'backend/poetry.lock'
python-version-file: 'backend/.python-version'
- name: Install dependencies
working-directory: ./backend
run: poetry install --no-interaction --with test
- name: Run the automated tests
working-directory: ./backend
id: run-test
run: poetry run pytest -v --cov=app --cov-report=term --cov-report=xml tests/
- name: Ensure 100% coverage for router files
working-directory: ./scripts
run: ./check_coverage.sh
lint-golang:
name: Run Go linters
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
if: ${{ github.actor != 'dependabot[bot]' || contains(github.head_ref, 'dependabot/go_modules')}}
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: cli/go.mod
cache-dependency-path: cli/go.sum
- name: Run golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
args: --timeout 15m0s
working-directory: cli
pre-commit:
name: Run pre-commit hooks
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
- name: Setup Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
cache: 'poetry'
cache-dependency-path: 'backend/poetry.lock'
python-version-file: 'backend/.python-version'
- name: Install Python dependencies
working-directory: backend
run: poetry install --no-interaction
- name: Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
cache: 'npm'
cache-dependency-path: 'frontend/package-lock.json'
node-version-file: 'frontend/package.json'
- name: Install npm dependencies
working-directory: frontend
run: npm ci --ignore-scripts --legacy-peer-deps
- name: Run pre-commit
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1