Develop #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| test: | |
| name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| 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 | |
| with: | |
| fetch-depth: 0 # Needed for setuptools-scm | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ./sai[test] | |
| pip install -e ./saigen[test] | |
| - name: Run tests | |
| run: | | |
| pytest --cov=sai --cov=saigen --cov-report=xml --cov-report=term | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' | |
| with: | |
| file: ./coverage.xml | |
| flags: unittests | |
| name: codecov-umbrella | |
| lint: | |
| name: Lint and Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ./sai[dev] | |
| pip install -e ./saigen[dev] | |
| - name: Run black | |
| run: black --check sai saigen tests | |
| - name: Run isort | |
| run: isort --check-only sai saigen tests | |
| - name: Run flake8 | |
| run: flake8 sai saigen tests | |
| - name: Run mypy | |
| run: mypy sai saigen | |
| build: | |
| name: Build Packages | |
| runs-on: ubuntu-latest | |
| needs: [test, lint] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Needed for setuptools-scm | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Build SAI package | |
| run: | | |
| cd sai | |
| python -m build | |
| twine check dist/* | |
| - name: Build SAIGEN package | |
| run: | | |
| cd saigen | |
| python -m build | |
| twine check dist/* | |
| - name: Upload SAI artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sai-dist | |
| path: sai/dist/ | |
| - name: Upload SAIGEN artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: saigen-dist | |
| path: saigen/dist/ |