Skip to content

IDS-631: Add frontend for idw yaml #4709

IDS-631: Add frontend for idw yaml

IDS-631: Add frontend for idw yaml #4709

name: Test Mytardis
on: [push, pull_request]
jobs:
build:
runs-on: [ubuntu-22.04]
strategy:
matrix:
python-version: ['3.10', '3.11']
es-version: ["8.11.1"]
name: Python ${{ matrix.python-version }}
steps:
- name: Install and Run Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: ${{ matrix.es-version }}
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install prerequisites
run: |
sudo apt-get update -yqq
sudo apt-get -yqq install --no-install-recommends -o=Dpkg::Use-Pty=0 \
libldap2-dev libsasl2-dev libmagic-dev libmagickwand-dev \
libssl-dev libxml2-dev libxslt1-dev zlib1g-dev \
libfreetype6-dev libjpeg-dev
#- name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install poetry
# poetry install --with ldap
# Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow
# from installing Poetry every time, which can be slow. Note the use of the Poetry version
# number in the cache key, and the "-0" suffix: this allows you to invalidate the cache
# manually if/when you want to upgrade Poetry, or if something goes wrong. This could be
# mildly cleaner by using an environment variable, but I don't really care.
- name: cache poetry install
uses: actions/cache@v2
with:
path: ~/.local
key: poetry
# Install Poetry. You could do this manually, or there are several actions that do this.
# `snok/install-poetry` seems to be minimal yet complete, and really just calls out to
# Poetry's default install script, which feels correct. I pin the Poetry version here
# because Poetry does occasionally change APIs between versions and I don't want my
# actions to break if it does.
#
# The key configuration value here is `virtualenvs-in-project: true`: this creates the
# venv as a `.venv` in your testing directory, which allows the next step to easily
# cache it.
- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
# Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache
# key: if you're using multiple Python versions, or multiple OSes, you'd need to include
# them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock.
- name: cache deps
id: cache-deps
uses: actions/cache@v2
with:
path: .venv
key: pydeps-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
# Add a step to rebuild the poetry.lock file. If the lock file gets out of date this will bring
# it back in line with the pyproject.toml file.
- run: poetry lock
# Install dependencies. `--no-root` means "install all dependencies but not the project
# itself", which is what you want to avoid caching _your_ code. The `if` statement
# ensures this only runs on a cache miss.
- run: poetry install --no-interaction --no-root --with s3,ldap,postgres,social_auth,sftp
if: steps.cache-deps.outputs.cache-hit != 'true'
- name: run macroacl tests
id: runMacroTests
run: |
mkdir -p var/store
poetry run python test.py
- name: run microacl tests
if: always() && (steps.runMacroTests.outcome == 'success' || steps.runMacroTests.outcome == 'failure')
run: |
poetry run python test_micro.py
- name: run pylint
run: |
poetry run pylint --rcfile .pylintrc --django-settings-module=tardis.test_settings tardis