From 54bb33c8f0d95bcca303f47b0455ca0ffd31d82f Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Mon, 24 Jun 2024 22:25:39 +0100 Subject: [PATCH] Add CI workflow to test Python code. --- .github/workflows/python.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/python.yml diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 00000000..9c9390c8 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,31 @@ +name: Python + +on: + push: + pull_request: + # Run automatically every monday + schedule: + - cron: 1 12 * * 1 + +jobs: + build-and-test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Build and install + run: python -m pip install amaranth_stdio luna_soc cynthion/python + + - name: Run unit tests + run: | + python -m unittest discover -s cynthion/python/tests + python -m cynthion.gateware.analyzer.analyzer