Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
2b866693cThis file is pinned to the selected release. Download the original to open it in your design tool.
name: build
on: [push, pull_request]
env:
IMAGE_NAME: kicad-kle2netlist
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade hatch
- name: Test
run: |
hatch run cov
- name: Upload coverage data
if: matrix.python-version == '3.11' && github.ref == 'refs/heads/master'
run: |
hatch run coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pure-python-wheel-and-sdist:
name: Build a pure Python wheel and source distribution
needs:
- tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install build dependencies
run: python -m pip install --upgrade build
- name: Build
run: python -m build
- uses: actions/upload-artifact@v4
with:
name: artifacts
path: dist/*
retention-days: 5
if-no-files-found: error
publish:
name: Publish release
needs:
- pure-python-wheel-and-sdist
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v4
with:
name: artifacts
path: dist
- name: Push build artifacts to PyPI
uses: pypa/gh-action-pypi-publish@v1.6.4
with:
skip_existing: true
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
run-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: extractions/setup-just@v3
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Build image
run: |
docker build . --file docker/Dockerfile --tag $IMAGE_NAME:dev \
--label "runnumber=${GITHUB_RUN_ID}"
- name: Fix ownership for Docker container user
run: sudo chown -R 1000:1000 .
- name: Run
run: |
cd examples/udb
just run-in-docker $IMAGE_NAME:dev
- name: Reset ownership back to GitHub runner (UID 1001)
run: sudo chown -R 1001:1001 .
- name: Deploy Project Artifacts to Vercel
run: |
vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
vercel build --token=${{ secrets.VERCEL_TOKEN }}
vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} > url.txt
working-directory: examples/udb/output
- name: Add summary
shell: bash
run: |
echo '### Deployed' >> $GITHUB_STEP_SUMMARY
cat examples/udb/output/url.txt >> $GITHUB_STEP_SUMMARY