|
| 1 | +name: Build Status |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + tags: [v*] |
| 7 | + pull_request: |
| 8 | + branches: [main] |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +permissions: |
| 16 | + contents: read |
| 17 | + checks: write |
| 18 | + pull-requests: write |
| 19 | + |
| 20 | +jobs: |
| 21 | + build: |
| 22 | + runs-on: ${{ matrix.os }} |
| 23 | + strategy: |
| 24 | + matrix: |
| 25 | + os: |
| 26 | + - ubuntu-24.04 # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md |
| 27 | + - macos-14 # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md |
| 28 | + - windows-2022 # https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md |
| 29 | + python-version: |
| 30 | + - "3.11" |
| 31 | + cibuildwheel: |
| 32 | + - "cp311" |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v4 |
| 35 | + with: |
| 36 | + submodules: 'true' |
| 37 | + |
| 38 | + - name: Setup cache (mac/linux) |
| 39 | + uses: actions/cache@v4 |
| 40 | + with: |
| 41 | + path: "/home/runner/work/verilator-python/verilator-python/.ccache" |
| 42 | + key: cache-${{ runner.os }}- |
| 43 | + restore-keys: cache-${{ runner.os }}- |
| 44 | + if: ${{ runner.os != 'Windows' }} |
| 45 | + |
| 46 | + - name: Setup cache (windows) |
| 47 | + uses: actions/cache@v4 |
| 48 | + with: |
| 49 | + path: "C:/ProgramData/chocolatey/" |
| 50 | + key: cache-${{ runner.os }}- |
| 51 | + restore-keys: cache-${{ runner.os }}- |
| 52 | + if: ${{ runner.os == 'Windows' }} |
| 53 | + |
| 54 | + - uses: actions-ext/python/setup@main |
| 55 | + with: |
| 56 | + version: ${{ matrix.python-version }} |
| 57 | + |
| 58 | + - name: Install dependencies |
| 59 | + run: pip install cibuildwheel |
| 60 | + |
| 61 | + - name: Python Wheel Steps (linux) |
| 62 | + run: python -m cibuildwheel --output-dir dist |
| 63 | + env: |
| 64 | + CIBW_BUILD: "${{ matrix.cibuildwheel }}-manylinux*" |
| 65 | + CIBW_ENVIRONMENT_LINUX: CCACHE_DIR="/host/home/runner/work/verilator-python/verilator-python/.ccache" |
| 66 | + CIBW_BUILD_VERBOSITY: 3 |
| 67 | + if: ${{ runner.os == 'Linux' }} |
| 68 | + |
| 69 | + - name: Python Build Steps (mac) |
| 70 | + run: python -m cibuildwheel --output-dir dist |
| 71 | + env: |
| 72 | + CIBW_BUILD: "${{ matrix.cibuildwheel }}-macos*" |
| 73 | + CIBW_ENVIRONMENT_MACOS: CCACHE_DIR="/Users/runner/work/verilator-python/verilator-python/.ccache" MACOSX_DEPLOYMENT_TARGET=11.0 |
| 74 | + CIBW_BUILD_VERBOSITY: 3 |
| 75 | + if: ${{ matrix.os == 'macos-14' }} |
| 76 | + |
| 77 | + - name: Python Build Steps (windows) |
| 78 | + run: python -m cibuildwheel --output-dir dist |
| 79 | + env: |
| 80 | + CIBW_BUILD: "${{ matrix.cibuildwheel }}-win_amd64" |
| 81 | + if: ${{ matrix.os == 'windows-2022' }} |
| 82 | + |
| 83 | + - name: Upload Wheel |
| 84 | + uses: actions/upload-artifact@v4 |
| 85 | + with: |
| 86 | + name: dist-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }} |
| 87 | + path: dist/*.whl |
| 88 | + |
| 89 | + - name: Install wheel (mac/linux) |
| 90 | + run: python -m pip install dist/*.whl |
| 91 | + if: ${{ runner.os != 'Windows' }} |
| 92 | + |
| 93 | + - name: Install wheel (windows) |
| 94 | + run: python -m pip install -U (Get-ChildItem .\dist\*.whl | Select-Object -Expand FullName) |
| 95 | + if: ${{ runner.os == 'Windows' }} |
| 96 | + |
| 97 | + - name: Install test dependencies |
| 98 | + run: python -m pip install pytest rich typer |
| 99 | + |
| 100 | + - name: Test Wheel |
| 101 | + run: python -m pytest -vvv verilator/tests |
0 commit comments