Add Docker and .devcontainer configuration. #419
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: Build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: frontend | |
- name: Base Setup | |
uses: ./frontend/.github/actions/base-setup | |
with: | |
frontend_folder: frontend | |
- name: Lint | |
working-directory: frontend | |
run: | | |
yarn install | |
yarn run eslint:check | |
yarn run prettier:check | |
shell: micromamba-shell {0} | |
- name: Install builder | |
run: | | |
micromamba install build | |
shell: bash -el {0} | |
- name: Package frontend | |
working-directory: frontend | |
run: python -m build -w . | |
shell: micromamba-shell {0} | |
- name: Upload package | |
uses: actions/upload-artifact@v2 | |
with: | |
name: quetz-frontend-wheel | |
path: frontend/dist/quetz_frontend*.whl | |
if-no-files-found: error | |
example: | |
name: Test Quetz frontend extension examples | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.10"] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: quetz-frontend-wheel | |
- run: | | |
cat > environment.yml << EOF | |
name: quetz | |
channels: | |
- https://repo.mamba.pm/conda-forge | |
dependencies: | |
- python=${{ matrix.python-version }} | |
- nodejs=16 | |
- yarn=1.21 | |
EOF | |
- uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-name: quetz | |
environment-file: environment.yml | |
cache-downloads: true | |
- name: Base Setup | |
run: | | |
set -ex | |
pip install quetz_frontend*.whl | |
# FIXME missing quetz server dependency | |
pip install "httpx~=0.20.0" | |
cat > dev_config.toml << EOF | |
[sqlalchemy] | |
database_url = "sqlite:///./quetz.sqlite" | |
[session] | |
secret = "b72376b88e6f249cb0921052ea8a092381ca17fd8bb0caf4d847e337b3d34cf8" | |
https_only = false | |
[logging] | |
level = "DEBUG" | |
file = "quetz.log" | |
[users] | |
admins = ["dummy:alice"] | |
EOF | |
quetz create --copy-conf ./dev_config.toml --dev /tmp/test_quetz | |
- uses: actions/checkout@v2 | |
- name: Build quetz packages | |
run: | | |
set -ex | |
yarn | |
yarn build:packages | |
shell: micromamba-shell {0} | |
- name: Install | |
working-directory: examples/light_theme | |
run: | | |
set -ex | |
yarn | |
# Build first so it link with local version of @quetz-frontend packages | |
yarn build | |
pip install -e . | |
quetz-frontend develop . | |
quetz-frontend list | |
quetz-frontend list 2>&1 | grep -ie "@quetz-example/light-theme" | |
shell: micromamba-shell {0} | |
- name: Set up browser cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
${{ github.workspace }}/pw-browsers | |
key: ${{ runner.os }}-${{ hashFiles('examples/tests/package.json') }} | |
- name: Install Playwright | |
working-directory: examples/tests | |
env: | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
run: | | |
set -ex | |
yarn | |
yarn playwright install chromium | |
shell: micromamba-shell {0} | |
- name: Test example | |
working-directory: examples/tests | |
run: | | |
set -ex | |
yarn test | |
shell: micromamba-shell {0} | |
- name: Upload Playwright Test report | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: light-theme-playwright-tests | |
path: | | |
examples/tests/test-results |