Skip to content

Openems

Openems #574

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
testing:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Restore PDK Directory
id: pdk-restore
uses: actions/cache/restore@v4
with:
path: |
pdk/
key: ${{ runner.os }}-pdk-${{ hashFiles('**/hades/techno.yml') }}
- uses: actions/checkout@v4
- name: Install winget - Windows
if: ${{runner.os == 'Windows' }}
uses: Cyberboss/install-winget@v1
- name: Config Windows - Setup External Tools
if: ${{runner.os == 'Windows' }}
run: |
dir
winget install KLayout --accept-package-agreements --accept-source-agreements --disable-interactivity
winget settings --enable LocalManifestFiles
winget install -m .\manifests\n\NGSpice\NGSpice\42
Add-Content $env:GITHUB_PATH "$env:LOCALAPPDATA\Microsoft\WinGet\Packages\NGSpice.NGSpice__DefaultSource\Spice64\bin"
winget install -m .\manifests\o\OpenEMS\OpenEMS\0.0.36
Add-Content $env:GITHUB_PATH "$env:LOCALAPPDATA\Microsoft\WinGet\Packages\OpenEMS.OpenEMS__DefaultSource\OpenEMS"
- name: Config Ubuntu - Install Nix
if: ${{runner.os != 'Windows' }}
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-24.05
extra_nix_config: 'experimental-features = nix-command'
- name: Config Ubuntu - Setup External Tools
if: ${{runner.os != 'Windows' }}
run: |
sudo apt-get update
sudo apt-get install -y klayout ngspice
nix-env -iA python311Packages.python-openems -f '<nixpkgs>'
nix-env -iA python311Packages.python-csxcad -f '<nixpkgs>'
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'poetry'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
poetry install --with dev,doc
poetry run pwd
- name: check and format
continue-on-error: true
run: |
poetry run ruff check --output-format=github .
poetry run ruff format --check .
- name: Install PDK
run: |
poetry run hades pdk install sky130
poetry run hades pdk install gf180mcu
- name: Install PDK - Windows
if: ${{runner.os == 'Windows' }}
run: |
poetry run volare enable --pdk sky130 --pdk-root ./pdk 6d4d11780c40b20ee63cc98e645307a9bf2b2ab8
poetry run volare enable --pdk gf180mcu --pdk-root ./pdk 6d4d11780c40b20ee63cc98e645307a9bf2b2ab8
poetry run volare ls
- if: ${{ steps.pdk-restore.outputs.cache-hit != 'true' }}
name: Save PDK Directory
id: pdk-save
uses: actions/cache/save@v4
with:
path: |
pdk/
key: ${{ steps.pdk-restore.outputs.cache-primary-key }}
- name: Build Doc
run: |
poetry run mkdocs build
- name: Test with Pytest
run: |
poetry run pytest -rxXs --basetemp=tmp