Update vitest monorepo to ^2.1.6 #3439
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/CD | |
on: push | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
test-py: | |
name: Test Python | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
python-version: | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
- '3.12' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Run checks for Python ${{ matrix.python-version }} | |
env: | |
CI: true | |
run: | | |
python --version | |
make git-attributes | |
make lint-py | |
make test-py | |
- name: Send coverage | |
uses: codecov/[email protected] | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
name: Backend Python ${{ matrix.python-version }} | |
files: .pytest-coverage.xml | |
flags: backend | |
fail_ci_if_error: true | |
verbose: true | |
test-js: | |
name: Test JavaScript | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Run checks | |
env: | |
CI: true | |
run: | | |
node --version | |
make git-attributes | |
make lint-js | |
make test-js | |
- name: Send coverage | |
uses: codecov/codecov-action@v5 | |
with: | |
name: Frontend | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage/clover.xml | |
flags: frontend | |
fail_ci_if_error: true | |
verbose: true | |
build: | |
name: Build Application | |
needs: | |
- test-py | |
- test-js | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Run build | |
env: | |
CI: true | |
run: | | |
make build | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: static | |
path: oereb_client/static | |
build-doc: | |
name: Build Documentation | |
needs: | |
- test-py | |
- test-js | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: | | |
sudo snap install yq | |
- name: Run build | |
env: | |
CI: true | |
run: | | |
make doc | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: doc | |
path: docs/build | |
create-docker-image-dev: | |
name: Build Docker Image (Dev) | |
needs: | |
- build | |
if: ${{ github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
flavor: | | |
latest=false | |
prefix= | |
suffix= | |
tags: | | |
dev | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
create-docker-image-tag: | |
name: Build Docker Image (Tag) | |
needs: | |
- build | |
if: ${{ startsWith(github.ref, 'refs/tags') }} | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
flavor: | | |
latest=true | |
prefix= | |
suffix= | |
tags: | | |
type=ref,event=tag | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
deploy-dev: | |
name: Deploy to PyPI Test | |
needs: | |
- build | |
if: ${{ github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: static | |
path: oereb_client/static | |
- name: Build packages | |
run: | | |
ls -ls oereb_client/static/build | |
python -m venv .venv | |
.venv/bin/pip install wheel setuptools -r requirements.txt | |
.venv/bin/python setup.py --test clean check sdist bdist_wheel | |
- name: Upload to PyPI Test | |
uses: pypa/[email protected] | |
with: | |
password: ${{ secrets.TEST_PYPI_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
deploy-tag: | |
name: Deploy to PyPI | |
needs: | |
- build | |
if: ${{ startsWith(github.ref, 'refs/tags') }} | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: static | |
path: oereb_client/static | |
- name: Build packages | |
run: | | |
ls -ls oereb_client/static/build | |
python -m venv .venv | |
.venv/bin/pip install wheel setuptools -r requirements.txt | |
.venv/bin/python setup.py clean check sdist bdist_wheel | |
- name: Upload to PyPI | |
uses: pypa/[email protected] | |
with: | |
password: ${{ secrets.PYPI_TOKEN }} | |
deploy-doc: | |
name: Deploy docs to GitHub Pages | |
needs: | |
- build-doc | |
if: ${{ startsWith(github.ref, 'refs/tags') }} | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download doc artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: doc | |
path: docs/build | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages | |
FOLDER: docs/build |