2.x changes #927
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: Run 2.x tests | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 8 * * *' # Run at 8AM UTC. | |
push: | |
branches: | |
- '1.x' | |
- '1.x-**' | |
pull_request: | |
branches: | |
- '1.x' | |
jobs: | |
build: | |
name: Run tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- 3.9 | |
- '3.10' | |
- 3.11 | |
- 3.12 | |
- 3.13 | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
- name: Create docker-compose.yml | |
run: curl https://raw.githubusercontent.com/farmOS/farmOS/3.x/docker/docker-compose.development.yml -o docker-compose.yml | |
- name: Start containers | |
run: docker compose up -d && sleep 5 | |
- name: Install farmOS | |
run: | | |
docker compose exec -u www-data -T www drush site-install -y --db-url=pgsql://farm:farm@db/farm --account-pass=admin | |
docker compose exec -u www-data -T www drush en farm_api_default_consumer -y | |
docker compose exec -u www-data -T www drush user-create tester --password test | |
docker compose exec -u www-data -T www drush user-add-role farm_manager tester | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest -e .[test] | |
- name: Check unasync | |
run: python farmOS/utils/unasync.py --check | |
- name: Run farmOS.py tests. | |
run: pytest tests | |
env: | |
FARMOS_HOSTNAME: 'http://localhost' | |
FARMOS_OAUTH_USERNAME: 'tester' | |
FARMOS_OAUTH_PASSWORD: 'test' |