From b871f2ad79a1ae28f7488c7d1c94780cc26e0494 Mon Sep 17 00:00:00 2001 From: Catherine Date: Wed, 27 Sep 2023 10:57:02 +0000 Subject: [PATCH] pyproject: use yowasp-yosys for tests. This change means that tests will succeed even if the system Yosys binary is broken. yices2 must still be present on the system. --- .env.toolchain | 7 +++++++ .github/workflows/main.yaml | 8 +------- pyproject.toml | 3 +++ 3 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 .env.toolchain diff --git a/.env.toolchain b/.env.toolchain new file mode 100644 index 0000000..d69bfbe --- /dev/null +++ b/.env.toolchain @@ -0,0 +1,7 @@ +AMARANTH_USE_YOSYS=system +YOSYS=yowasp-yosys +SBY=yowasp-sby +SMTBMC=yowasp-yosys-smtbmc +# examples +NEXTPNR_ICE40=yowasp-nextpnr-ice40 +ICEPACK=yowasp-icepack \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index da5244a..295b302 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -46,15 +46,9 @@ jobs: sudo add-apt-repository 'deb http://ppa.launchpad.net/sri-csl/formal-methods/ubuntu bionic main' sudo apt-get update sudo apt-get install yices2 - pip install codecov yowasp-yosys + pip install codecov pdm install --dev - name: Run tests - env: - YOSYS: yowasp-yosys - NEXTPNR_ICE40: yowasp-nextpnr-ice40 - ICEPACK: yowasp-icepack - SBY: yowasp-sby - SMTBMC: yowasp-yosys-smtbmc run: | pdm run test - name: Submit code coverage diff --git a/pyproject.toml b/pyproject.toml index 8155b54..5b22dfa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,6 +49,7 @@ includes = ["amaranth/"] [tool.pdm.dev-dependencies] test = [ + "yowasp-yosys", "coverage", ] docs = [ @@ -62,6 +63,8 @@ examples = [ ] [tool.pdm.scripts] +_.env_file = ".env.toolchain" + test.composite = ["test-code", "test-docs"] test-code.env = {PYTHONWARNINGS = "error"} test-code.cmd = "python -m coverage run -m unittest discover -t . -s tests -v"