From 5bf2c8e3f2c8f175a68c12f3cd6f77ded474edf4 Mon Sep 17 00:00:00 2001 From: Chen Kasirer Date: Fri, 30 Aug 2024 17:16:08 +0200 Subject: [PATCH] tasks and build workflow --- .github/workflows/build.yml | 43 ++++++++++++++++++------------------- tasks.py | 8 ++++++- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de577b6..c131ca8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,36 +1,35 @@ -name: build +name: Build & test on: push: branches: - main + pull_request: - branches: - - main + branches: + - main jobs: build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - python: ['3.10'] + name: Build distribution 📦 + runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python }} + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" - - name: Install dependencies + package - run: | - python -m pip install --upgrade pip - pip install -r requirements-dev.txt - pip install . + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt - - name: Run tests - run: pytest + - name: Install package + run: | + pip install . + - name: Install package + run: | + invoke test diff --git a/tasks.py b/tasks.py index 4dca966..a81c45e 100644 --- a/tasks.py +++ b/tasks.py @@ -1,4 +1,4 @@ -"""Everything here is shamelessly copied from compas_invocations2""" +"""Everything here is shamelessly copied from https://github.com/compas-dev/compas_invocations2""" import sys import glob @@ -190,3 +190,9 @@ def prepare_changelog(ctx): changelog.write(content.replace("## ", UNRELEASED_CHANGELOG_TEMPLATE, 1)) ctx.run('git add CHANGELOG.md && git commit -m "Prepare changelog for next release"') + + +@invoke.task +def test(ctx): + """Run tests.""" + ctx.run("pytest")