Skip to content

use nix-shell for linux and windows #626

use nix-shell for linux and windows

use nix-shell for linux and windows #626

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 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"
wsl --update
wsl --set-default-version 2
- name: Config WSL for Windows
if: ${{runner.os == 'Windows' }}
uses: Vampire/setup-wsl@v3
with:
distribution: Ubuntu-24.04
- name: Install NIX for Windows
if: ${{runner.os == 'Windows' }}
shell: wsl-bash {0}
run: |
sh <(curl -L https://nixos.org/nix/install) --no-daemon --yes
echo ". $HOME/.nix-profile/etc/profile.d/nix.sh" >> ~/.bashrc
source ~/.bashrc
- name: Install Nix for Ubuntu
if: ${{runner.os != 'Windows' }}
uses: cachix/install-nix-action@v27
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
- 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: |
python -m pip install --upgrade pip
poetry lock --no-update
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
- name: Store reports
if: failure()
uses: actions/upload-artifact@v3
with:
name: reports
path: |
tmp/
pytest.log