summaryrefslogtreecommitdiff
path: root/.github/workflows/main.yml
blob: 7d6b455b1cf53c90dc14526c64752d0e32736db0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: tests

on: [push, pull_request]

jobs:
  test:
    strategy:
      matrix:
        python:
        - 3.6
        - 3.9
        - 3.10.0-alpha - 3.10.99
        platform: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.platform }}
    steps:
      - uses: actions/checkout@v2
      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python }}
      - name: Install tox
        run: |
          python -m pip install tox
      - name: Run tests
        run: tox

  release:
    needs: test
    if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.9
      - name: Install tox
        run: |
          python -m pip install tox
      - name: Release
        run: tox -e release
        env:
          TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}