Skip to content

version bump and added dockerfile #220

version bump and added dockerfile

version bump and added dockerfile #220

Workflow file for this run

name: Build Files and Run Tests
on:
pull_request:
branches:
- main
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Python for Docs
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: "pip"
cache-dependency-path: |
setup.cfg
docs/requirements.txt
- name: Build Docs
run: |
python -m pip install --upgrade pip
pip install .
pip install -r docs/requirements.txt
sphinx-build -b html docs docs/html
build-frontend:
runs-on: ubuntu-latest
outputs:
any_changed: ${{ steps.check-changes.outputs.any_changed }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Check for changes in zt_frontend/
id: check-changes
uses: tj-actions/changed-files@v40
with:
files: zt_frontend/**
base_sha: ${{ github.event.pull_request.base.sha }}
- name: Build Frontend if changed
if: steps.check-changes.outputs.any_changed == 'true'
run: |
npm install --global yarn
ls -a
rm -r zt_backend/dist_dev/
rm -r zt_backend/dist_app/
cd zt_frontend
yarn install
yarn run build
cp -r dist/ ../zt_backend/dist_dev/
yarn run buildapp
cp -r dist/ ../zt_backend/dist_app/
- name: Upload Frontend Artifacts
if: steps.check-changes.outputs.any_changed == 'true'
uses: actions/upload-artifact@v3
with:
name: frontend-files
path: |
zt_backend/dist_app/
zt_backend/dist_dev/
test:
runs-on: ${{ matrix.os }}
needs: build-frontend
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: setup.cfg
- name: Remove Existing Frontend Files (Windows)
if: runner.os == 'Windows' && needs.build-frontend.outputs.any_changed == 'true'
run: |
Remove-Item -Path zt_backend\dist_dev -Force -Recurse
Remove-Item -Path zt_backend\dist_app -Force -Recurse
shell: powershell
# Only run this step on Windows
- name: Remove Existing Frontend Files (Linux/Mac)
if: runner.os != 'Windows' && needs.build-frontend.outputs.any_changed == 'true'
run: |
rm -rf zt_backend/dist_dev
rm -rf zt_backend/dist_app
- name: Download Frontend Files
if: needs.build-frontend.outputs.any_changed == 'true'
uses: actions/download-artifact@v3
with:
name: frontend-files
path: zt_backend/
- name: Install
run: |
pip install . --no-compile
- name: Setup Chrome
uses: nanasess/setup-chromedriver@v2
- name: Test with pytest
run: pytest