Skip to content

chore: add node to cypress workflow #4

chore: add node to cypress workflow

chore: add node to cypress workflow #4

Workflow file for this run

name: Frontend tests
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
NODE_VERSION: '20'
PYTHON_VERSION: '3.9'
permissions:
contents: read
jobs:
test:
strategy:
matrix:
ckan-version: ["2.10"]
fail-fast: false
runs-on: ubuntu-latest
container:
# The CKAN version tag of the Solr and Postgres containers should match
# the one of the container the tests run on.
# You can switch this base image with a custom image tailored to your project
image: openknowledge/ckan-dev:${{ matrix.ckan-version }}
services:
solr:
image: ckan/ckan-solr:${{ matrix.ckan-version }}
postgres:
image: ckan/ckan-postgres-dev:${{ matrix.ckan-version }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:3
env:
CKAN_SQLALCHEMY_URL: postgresql://ckan_default:pass@postgres/ckan_test
CKAN_DATASTORE_WRITE_URL: postgresql://datastore_write:pass@postgres/datastore_test
CKAN_DATASTORE_READ_URL: postgresql://datastore_read:pass@postgres/datastore_test
CKAN_SOLR_URL: http://solr:8983/solr/ckan
CKAN_REDIS_URL: redis://redis:6379/1
steps:
- uses: actions/checkout@v4
- name: Install requirements
run: |
pip install -e '.[dev]'
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup extension
run: |
sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' test.ini
ckan -c test.ini db upgrade
yes | ckan -c test.ini sysadmin add admin password=password123 email=admin@test.net
- name: Run Cypress
uses: cypress-io/github-action@v6
with:
start: ckan -c test.ini run
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: cypress/videos