| name: build |
| on: |
| push: |
| branches: [master] |
| pull_request: |
| branches: [master] |
| jobs: |
| tests: |
| runs-on: ubuntu-latest |
| strategy: |
| fail-fast: false |
| matrix: |
| python-version: ["3.10", "3.11", "3.12"] |
| |
| steps: |
| - name: Checkout |
| uses: actions/checkout@v2 |
| |
| - name: Set up Python ${{ matrix.python-version }} |
| uses: actions/setup-python@v2 |
| with: |
| python-version: ${{ matrix.python-version }} |
| |
| - name: Upgrade install tools |
| run: python -m pip install --upgrade setuptools wheel |
| |
| - name: Install dependencies |
| run: | |
| pip install -r requirements.txt |
| |
| - name: Run tests |
| run: | |
| python -m unittest discover -s tests -t tests |
| |
| coveralls: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout |
| uses: actions/checkout@v2 |
| |
| - name: Set up Python |
| uses: actions/setup-python@v2 |
| with: |
| python-version: 3.11 |
| |
| - name: Install dependencies |
| run: | |
| pip install -r requirements.txt |
| pip install coveralls |
| pip install coverage |
| |
| - name: Run tests |
| run: coverage run -m unittest discover -s tests -t tests |
| |
| - name: Upload coverage data to coveralls.io |
| run: coveralls --service=github |
| env: |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| |
| release: |
| name: Release |
| runs-on: ubuntu-latest |
| needs: [ tests, coveralls ] |
| steps: |
| - name: Checkout |
| uses: actions/checkout@v2 |
| with: |
| fetch-depth: 0 |
| |
| - name: Setup Node.js |
| uses: actions/setup-node@v1 |
| with: |
| node-version: '20' |
| |
| - name: Setup |
| run: npm install -g semantic-release @semantic-release/github @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/git @semantic-release/release-notes-generator semantic-release-pypi |
| |
| - name: Set up python |
| uses: actions/setup-python@v2 |
| with: |
| python-version: 3.11 |
| |
| - name: Install setuptools |
| run: python -m pip install --upgrade setuptools wheel twine |
| |
| - name: Release |
| env: |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |
| run: npx semantic-release |