Skip to content

Test and build python package #50

Test and build python package

Test and build python package #50

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Test and build python package
on:
push:
tags:
- 'v*.*.*'
branches:
- master
schedule:
# weekly
- cron: '0 0 * * 1'
permissions:
contents: read
jobs:
# test on several python versions
test-build:
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.11]
name: Test and build python package version ${{ matrix.python-version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '${{ matrix.python-version }}'
- name: Assemble python package
run: |
mv model/ ddpm/
cp -r variance_scheduler/ ddpm/
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
python -m pip install .[dev]
- name: Test model/ folder
run: |
mv ddpm model
python -m pytest
mv model ddpm
- name: Build package
run: python -m build