Skip to content

Commit

Permalink
Create test_trivial.py (#69)
Browse files Browse the repository at this point in the history
* Create test_trivial.py

* test for Python code

* updates from main (#70)

* Update action.yml (#68)

* Update action.yml (#67)

* test for Python code

* test for Python code

* test for Python code

* test for Python code
  • Loading branch information
tschm authored Jun 9, 2024
1 parent 4184ae0 commit f032b43
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 54 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "ci"

on:
push

jobs:
test:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
python-version: ['3.9', '3.10', '3.11', '3.12' ]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Set up Git repository
uses: actions/checkout@v4

- uses: ./actions/test
with:
python-version: ${{ matrix.python-version }}
#source-folder: "tests/python"
4 changes: 2 additions & 2 deletions actions/dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ on:
description: 'Python version'
type: string
required: false
default: '3.10'
default: '3.11'

runs:
using: "composite"
steps:

- uses: cvxgrp/.github/actions/setup-environment@main
with:
python-version: "${{ inputs.python-version || '3.10' }}"
python-version: "${{ inputs.python-version || '3.11' }}"

- name: Export dependencies
shell: bash
Expand Down
12 changes: 2 additions & 10 deletions actions/deptry/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ description: "Perform Deptry"
on:
workflow_call:
inputs:
python-version:
description: 'Python version'
type: string
required: false
default: '3.10'
source-folder:
description: 'Source folder'
type: string
Expand All @@ -33,16 +28,13 @@ runs:
using: "composite"
steps:
- uses: cvxgrp/.github/actions/setup-environment@main
with:
python-version: ${{ inputs.python-version || '3.10' }}

- name: Install deptry
shell: bash
run: |
poetry run pip install --no-cache-dir \
deptry
poetry run pip install --no-cache-dir deptry
- name: Run tests
- name: Run deptry
shell: bash
run : |
poetry run deptry ${{ inputs.source-folder || 'cvx' }}
7 changes: 0 additions & 7 deletions actions/docstr/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ description: "Analyse docstrings"
on:
workflow_call:
inputs:
python-version:
description: 'Python version'
type: string
required: false
default: '3.10'
source-folder:
description: 'Source folder'
type: string
Expand All @@ -33,8 +28,6 @@ runs:
using: "composite"
steps:
- uses: cvxgrp/.github/actions/setup-environment@main
with:
python-version: ${{ inputs.python-version || '3.10' }}

- name: Install pytest
shell: bash
Expand Down
7 changes: 0 additions & 7 deletions actions/jupyter/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ description: "Build jupyter book"
on:
workflow_call:
inputs:
python-version:
description: 'Python version'
type: string
required: false
default: '3.10'
kernel:
description: 'Jupyter kernel'
type: string
Expand All @@ -37,8 +32,6 @@ runs:
# uses: actions/checkout@v4

- uses: cvxgrp/.github/actions/setup-environment@main
with:
python-version: ${{ inputs.python-version || '3.10' }}

- name: Install jupyterbook
shell: bash
Expand Down
7 changes: 0 additions & 7 deletions actions/pdoc/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ description: "Build pdoc documentation"
on:
workflow_call:
inputs:
python-version:
description: 'Python version'
type: string
required: false
default: '3.10'
source-folder:
description: 'Source folder'
type: string
Expand All @@ -38,8 +33,6 @@ runs:

steps:
- uses: cvxgrp/.github/actions/setup-environment@main
with:
python-version: ${{ inputs.python-version || '3.10' }}

- name: Install pdoc
shell: bash
Expand Down
11 changes: 0 additions & 11 deletions actions/release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,11 @@ name: Release

description: "Release with poetry"

on:
workflow_call:
inputs:
python-version:
description: 'Python version'
type: string
required: false
default: '3.10'

runs:
using: "composite"

steps:
- uses: cvxgrp/.github/actions/setup-environment@main
with:
python-version: "${{ inputs.python-version || '3.10' }}"

- name: Change version in pyproject.toml
shell: bash
Expand Down
6 changes: 3 additions & 3 deletions actions/setup-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
description: 'Python version'
type: string
required: false
default: '3.10'
default: '3.11'

runs:
using: "composite"
Expand All @@ -34,7 +34,7 @@ runs:
uses: actions/setup-python@v5
with:
# Why is this not automatically happen?
python-version: ${{ inputs.python-version || '3.10' }}
python-version: ${{ inputs.python-version || '3.11' }}

- name: Install Poetry
uses: snok/install-poetry@v1
Expand Down Expand Up @@ -65,7 +65,7 @@ runs:
poetry show --only main --tree > artifacts/build/show.txt
- name: Archive Documentation
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@4
with:
name: build
path: artifacts/build
Expand Down
7 changes: 0 additions & 7 deletions actions/sphinx/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ description: "Build sphinx documentation"
on:
workflow_call:
inputs:
python-version:
description: 'Python version'
type: string
required: false
default: '3.10'
sphinx-folder:
description: 'Sphinx folder'
type: string
Expand All @@ -34,8 +29,6 @@ runs:

steps:
- uses: cvxgrp/.github/actions/setup-environment@main
with:
python-version: ${{ inputs.python-version || '3.10' }}

- name: Install sphinx
shell: bash
Expand Down
Empty file added tests/python/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions tests/python/test_trivial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def test_trivial():
assert True


# def test_dog():
# dog = Dog(name="Peter Maffay")
# assert dog.name == "Peter Maffay"

0 comments on commit f032b43

Please sign in to comment.