Skip to content

Merge pull request #280 from Patarimi/dependabot/github_actions/astra… #739

Merge pull request #280 from Patarimi/dependabot/github_actions/astra…

Merge pull request #280 from Patarimi/dependabot/github_actions/astra… #739

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:
check-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3
with:
args: 'format --check'
doc-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: 'poetry'
- run: |
pip install --upgrade pip
poetry install --with doc
- name: Build Doc
run: |
poetry run mkdocs build
testing:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
needs: [check-format, doc-build]
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 settings --enable LocalManifestFiles
winget install -m .\manifests\n\NGSpice\NGSpice\42
winget install -m .\manifests\o\OpenEMS\OpenEMS\0.0.36
Add-Content $env:GITHUB_PATH "$env:LOCALAPPDATA\Microsoft\WinGet\Packages\NGSpice.NGSpice__DefaultSource\Spice64\bin"
Add-Content $env:GITHUB_PATH "$env:LOCALAPPDATA\Microsoft\WinGet\Packages\OpenEMS.OpenEMS__DefaultSource\OpenEMS"
- name: Install Nix for Ubuntu
if: ${{runner.os != 'Windows' }}
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-24.05
- name: Config Ubuntu - Setup External Tools
if: ${{runner.os != 'Windows' }}
run: |
sudo apt-get update
sudo apt-get install -y ngspice
nix-channel --update
nix-channel --list
# nix-env -i openems -f '<nixpkgs>'
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: 'poetry'
- name: Install Dependencies
run: |
poetry show --tree
poetry install --with=dev
poetry run pwd
- 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 pip install .\manifests\openEMS-0.0.36-cp310-cp310-win_amd64.whl
poetry run pip install .\manifests\CSXCAD-0.6.3-cp310-cp310-win_amd64.whl
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: Test with Pytest
run: |
poetry run pytest -rxXs --basetemp=tmp
- name: Store reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: reports-${{ matrix.os }}
path: |
tmp/
pytest.log