|
| 1 | +name: Tests |
| 2 | +on: |
| 3 | + - push |
| 4 | + - pull_request |
| 5 | +jobs: |
| 6 | + test: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + strategy: |
| 9 | + matrix: |
| 10 | + python-version: [2.7, 3.5, 3.6, 3.7, 3.8, pypy2, pypy3] |
| 11 | + steps: |
| 12 | + - name: Checkout code |
| 13 | + uses: actions/checkout@v2 |
| 14 | + - name: Set up Python ${{ matrix.python-version }} |
| 15 | + uses: actions/setup-python@v1 |
| 16 | + with: |
| 17 | + python-version: ${{ matrix.python-version }} |
| 18 | + - name: Install dependencies |
| 19 | + run: | |
| 20 | + python -m pip install --upgrade pip |
| 21 | + pip install ".[dev]" |
| 22 | + - name: Test with inv |
| 23 | + run: inv cover qa |
| 24 | + - name: Coveralls |
| 25 | + run: | |
| 26 | + pip install coveralls |
| 27 | + coveralls --rcfile=coverage.rc |
| 28 | + env: |
| 29 | + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
| 30 | + bench: |
| 31 | + needs: test |
| 32 | + runs-on: ubuntu-latest |
| 33 | + if: github.event_name == 'pull_request' |
| 34 | + steps: |
| 35 | + - name: Set up Python 3.8 |
| 36 | + uses: actions/setup-python@v1 |
| 37 | + with: |
| 38 | + python-version: 3.8 |
| 39 | + - name: Checkout ${{ github.base_ref }} |
| 40 | + uses: actions/checkout@v2 |
| 41 | + with: |
| 42 | + ref: ${{ github.base_ref}} |
| 43 | + path: base |
| 44 | + - name: Checkout ${{ github.ref }} |
| 45 | + uses: actions/checkout@v2 |
| 46 | + with: |
| 47 | + ref: ${{ github.ref}} |
| 48 | + path: ref |
| 49 | + - name: Install dev dependencies |
| 50 | + run: | |
| 51 | + python -m pip install --upgrade pip |
| 52 | + pip install -e "base[dev]" |
| 53 | + pip install -e "base[ci]" |
| 54 | + - name: Install ci dependencies for ${{ github.base_ref }} |
| 55 | + run: pip install -e "base[ci]" |
| 56 | + - name: Benchmarks for ${{ github.base_ref }} |
| 57 | + run: | |
| 58 | + cd base |
| 59 | + inv benchmark --max-time 4 --save |
| 60 | + - name: Install ci dependencies for ${{ github.ref }} |
| 61 | + run: pip install -e "ref[ci]" |
| 62 | + - name: Benchmarks for ${{ github.ref }} |
| 63 | + run: | |
| 64 | + cd ref |
| 65 | + inv benchmark --max-time 4 --compare |
0 commit comments