Add support for viewing AMS Filaments #43
Workflow file for this run
This file contains hidden or 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: Test and Build | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
tags: | |
- "*" | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
format_ts: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Cache node modules | |
id: cache-nodemodules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install Dependencies | |
if: steps.cache-nodemodules.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: format | |
run: npx prettier backend/ --check | |
lint_format_typecheck_py: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- uses: actions/cache@v3 | |
id: cache-venv | |
with: | |
path: ./.venv/ | |
key: ${{ runner.os }}-venv-${{ hashFiles('**/pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-venv- | |
- run: pip install poetry | |
- run: | | |
poetry install --with dev --no-root | |
if: steps.cache-venv.outputs.cache-hit != 'true' | |
- name: Run Ruff | |
run: | | |
poetry run ruff check . | |
poetry run ruff format . --check | |
- name: typecheck | |
run: | | |
poetry run mypy . | |
build_and_push: | |
name: build_and_push | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
needs: | |
- format_ts | |
- lint_format_typecheck_py | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
env: | |
DOCKER_METADATA_PR_HEAD_SHA: true | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | |
tags: | | |
type=raw,value=edge,enable=${{ github.ref == 'refs/heads/main' }} | |
type=sha,format=short | |
type=semver,pattern={{raw}} | |
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: ${{ steps.meta.outputs.tags }} | |
platforms: linux/amd64,linux/arm64/v8 |