|  | 
| 1 |  | -on: [push, pull_request] | 
|  | 1 | +on: | 
|  | 2 | +  push: | 
|  | 3 | +  pull_request: | 
|  | 4 | +  schedule: | 
|  | 5 | +  - cron: '0 0 * * *' # test daily against git HEAD of dependencies | 
|  | 6 | + | 
| 2 | 7 | name: CI | 
| 3 | 8 | jobs: | 
|  | 9 | + | 
| 4 | 10 |   test: | 
| 5 | 11 |     runs-on: ubuntu-latest | 
|  | 12 | +    strategy: | 
|  | 13 | +      matrix: | 
|  | 14 | +        python-version: | 
|  | 15 | +        - '3.8' | 
|  | 16 | +        - '3.9' | 
|  | 17 | +        - '3.10' | 
|  | 18 | +        - '3.11' | 
|  | 19 | +        - 'pypy-3.8' | 
|  | 20 | +        - 'pypy-3.9' | 
|  | 21 | +        # this version range needs to be synchronized with the one in pyproject.toml | 
|  | 22 | +        amaranth-version: | 
|  | 23 | +        - '0.4' | 
|  | 24 | +        - 'git' | 
|  | 25 | +        allow-failure: | 
|  | 26 | +        - true | 
|  | 27 | +        - false | 
|  | 28 | +        exclude: # all of these are inverted (this is unfortunately the best way to do this) | 
|  | 29 | +        - amaranth-version: '0.4' | 
|  | 30 | +          allow-failure: false | 
|  | 31 | +        - amaranth-version: 'git' | 
|  | 32 | +          allow-failure: true | 
|  | 33 | +    continue-on-error: '${{ matrix.allow-failure }}' | 
|  | 34 | +    name: "test (${{ matrix.python-version }}, ${{ matrix.amaranth-version }}${{ matrix.allow-failure == 'false' && ', required' || '' }})" | 
| 6 | 35 |     steps: | 
| 7 | 36 |       - name: Check out source code | 
| 8 |  | -        uses: actions/checkout@v2 | 
|  | 37 | +        uses: actions/checkout@v3 | 
| 9 | 38 |       - name: Set up Python | 
| 10 |  | -        uses: actions/setup-python@v2 | 
| 11 |  | -      - name: Install dependencies | 
|  | 39 | +        uses: actions/setup-python@v4 | 
|  | 40 | +        with: | 
|  | 41 | +          python-version: ${{ matrix.python-version }} | 
|  | 42 | +      - name: Install Amaranth release | 
|  | 43 | +        if: ${{ matrix.amaranth-version != 'git' }} | 
| 12 | 44 |         run: | | 
| 13 |  | -          pip install wheel | 
| 14 |  | -      - name: Test | 
|  | 45 | +          pip install 'amaranth[builtin-yosys] ==${{ matrix.amaranth-version }}' | 
|  | 46 | +      - name: Install Amaranth from git | 
|  | 47 | +        if: ${{ matrix.amaranth-version == 'git' }} | 
| 15 | 48 |         run: | | 
| 16 |  | -          python setup.py test | 
|  | 49 | +          pip install 'amaranth[builtin-yosys] @ git+https://github.com/amaranth-lang/amaranth.git' | 
|  | 50 | +      - name: Run tests | 
|  | 51 | +        run: | | 
|  | 52 | +          python -m unittest discover -t . -s amaranth_boards -p '*.py' | 
|  | 53 | +
 | 
|  | 54 | +  required: # group all required workflows into one to avoid reconfiguring this in Actions settings | 
|  | 55 | +    needs: | 
|  | 56 | +      - test | 
|  | 57 | +    if: ${{ always() && !contains(needs.*.result, 'cancelled') }} | 
|  | 58 | +    runs-on: ubuntu-latest | 
|  | 59 | +    steps: | 
|  | 60 | +      - run: ${{ contains(needs.*.result, 'failure') && 'false' || 'true' }} | 
0 commit comments