build(deps): bump sortablejs from 1.15.2 to 1.15.3 in /frontend #4054
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
- push | |
- pull_request | |
jobs: | |
Python-Test: | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: redis:latest | |
ports: | |
- 6379:6379 | |
postgres: | |
image: postgres:14 | |
env: | |
POSTGRES_DB: varfish_web | |
POSTGRES_USER: varfish_web | |
POSTGRES_PASSWORD: varfish_web | |
DATABASE_URL: postgres://varfish_web:varfish_web@postgres/varfish_web | |
CELERY_BROKER_URL: redis://redis:6379/0 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
ports: | |
- 5432:5432 | |
# We launch a minio instance for testing. Note that we use the bitnami | |
# image because of the issue lined out in this SO discussion: | |
# | |
# - https://stackoverflow.com/questions/64031598 | |
minio: | |
image: bitnami/minio:latest | |
env: | |
MINIO_ROOT_USER: minioadmin | |
MINIO_ROOT_PASSWORD: minio-root-password | |
options: >- | |
--name=minio | |
--health-cmd "curl http://localhost:9000/minio/health/live" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
ports: | |
- 9000:9000 | |
env: | |
CELERY_BROKER_URL: redis://0.0.0.0:6379/0 | |
DATABASE_URL: 'postgres://varfish_web:[email protected]/varfish_web' | |
POSTGRES_HOST: 0.0.0.0 | |
POSTGRES_PORT: 5432 | |
VARFISH_CASE_IMPORT_INTERNAL_STORAGE: | | |
{ | |
"bucket": "varfish-server-test", | |
"host": "minio", | |
"port": 9000, | |
"access_key": "varfish-server-test", | |
"secret_key": "varfish-server-test" | |
} | |
steps: | |
- name: Perform minio client setup | |
run: | | |
set -x | |
# create host alias for minio | |
echo "127.0.0.1 minio" | sudo tee -a /etc/hosts | |
# install minio client and configure default alias | |
wget -O /usr/local/bin/mc https://dl.min.io/client/mc/release/linux-amd64/mc | |
chmod +x /usr/local/bin/mc | |
mc alias set minio/ http://minio:9000 minioadmin minio-root-password | |
# setup bucket and access key for tests | |
mc mb minio/varfish-server-test | |
mc admin user add minio varfish-server-test varfish-server-test | |
# write policy file for bucket access, add it to server, and associate with | |
# access key created above | |
cat >/tmp/policy.json <<"EOF" | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"s3:DeleteObject", | |
"s3:GetBucketLocation", | |
"s3:GetObject", | |
"s3:ListBucket", | |
"s3:PutObject" | |
], | |
"Effect": "Allow", | |
"Resource": [ | |
"arn:aws:s3:::varfish-server-test/*", | |
"arn:aws:s3:::varfish-server-test" | |
], | |
"Sid": "BucketAccessForUser" | |
} | |
] | |
} | |
EOF | |
mc admin policy create minio varfish-server-test-policy /tmp/policy.json | |
mc admin policy attach minio varfish-server-test-policy --user varfish-server-test | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential zlib1g-dev libtiff5-dev libjpeg8-dev \ | |
libfreetype6-dev liblcms2-dev libwebp-dev libpq-dev graphviz-dev \ | |
libldap2-dev libsasl2-dev | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
lfs: true | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
# We need to fix the patch version here otherwise, snapshot tests | |
# with randomness will / may fail. | |
python-version: "3.10.13" | |
- name: Install pip and Pipenv | |
run: | | |
pip install -U pip pipenv | |
working-directory: backend | |
- name: Install project dependencies with pipenv | |
run: | | |
pipenv install --verbose --categories=packages,dev-packages,ldap-packages | |
working-directory: backend | |
- name: Run collectstatic (will download icons and build frontend) | |
run: make collectstatic | |
working-directory: backend | |
- name: Build Vue app as that can be tested via selenium. | |
run: | | |
npm ci | |
npm run build | |
nohup npm run serve & | |
working-directory: frontend | |
- name: Setup environment with worker | |
uses: mamba-org/setup-micromamba@v2 | |
with: | |
environment-file: environment.yaml | |
init-shell: bash | |
cache-environment: true | |
post-cleanup: 'all' | |
- name: Run tests | |
run: | | |
make test | |
# Important: use shell that was initialized by micromamba. | |
shell: bash -el {0} | |
working-directory: backend | |
- name: Upload Python coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
flags: python | |
directory: backend | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
Python-Lint: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
lfs: true | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install pip and Pipenv | |
run: pip install pip pipenv | |
working-directory: backend | |
- name: Install project dependencies with pipenv | |
run: make deps | |
working-directory: backend | |
- name: Run all lints | |
run: | | |
rm -rf src | |
make lint | |
working-directory: backend | |
- name: Check for OpenAPI schema changes | |
run: | | |
pipenv run python manage.py spectacular \ | |
--file /tmp/varfish_api_schema.yaml | |
diff \ | |
varfish/tests/drf_openapi_schema/varfish_api_schema.yaml \ | |
/tmp/varfish_api_schema.yaml | |
shell: bash -euo pipefail {0} | |
working-directory: backend | |
Node-Lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
lfs: true | |
- name: Install javascript dependencies | |
run: | | |
make deps | |
working-directory: frontend | |
- name: Run linting | |
run: | | |
make lint | |
working-directory: frontend | |
# # TODO: it appears that this is not stable | |
# - name: Check for OpenAPI schema changes. | |
# run: | | |
# npx openapi-typescript \ | |
# ../backend/varfish/tests/drf_openapi_schema/varfish_api_schema.yaml \ | |
# -o /tmp/varfish.d.ts | |
# | |
# diff \ | |
# src/varfish/api/varfish.d.ts \ | |
# /tmp/varfish.d.ts | |
# shell: bash -euo pipefail {0} | |
# working-directory: frontend | |
Node-Test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
lfs: true | |
- name: Install javascript dependencies | |
run: | | |
make deps | |
working-directory: frontend | |
- name: Run Vue app tests | |
run: | | |
make test | |
working-directory: frontend | |
- name: Upload nodejs coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
flags: nodejs | |
directory: frontend | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |