|
| 1 | +name: test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - master |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: test-${{ github.head_ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +env: |
| 16 | + PYTHONUNBUFFERED: "1" |
| 17 | + FORCE_COLOR: "1" |
| 18 | + |
| 19 | +jobs: |
| 20 | + run: |
| 21 | + name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} |
| 22 | + runs-on: ${{ matrix.os }} |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 27 | + python-version: ['3.8', '3.9', '3.10'] |
| 28 | + |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v2 |
| 31 | + |
| 32 | + - name: Set up Python ${{ matrix.python-version }} |
| 33 | + uses: actions/setup-python@v2 |
| 34 | + with: |
| 35 | + python-version: ${{ matrix.python-version }} |
| 36 | + |
| 37 | + - name: Ensure latest pip |
| 38 | + run: python -m pip install --upgrade pip |
| 39 | + |
| 40 | + - name: Install ourself |
| 41 | + run: pip install -e . |
| 42 | + |
| 43 | + - if: matrix.python-version == '3.9' && runner.os == 'Linux' |
| 44 | + name: Lint |
| 45 | + run: hatch run lint:all |
| 46 | + |
| 47 | + - name: Run tests |
| 48 | + env: |
| 49 | + HATCH_CI_PUBLISHER_TOKEN: ${{ secrets.HATCH_CI_PUBLISHER_TOKEN }} |
| 50 | + run: hatch run full |
| 51 | + |
| 52 | + downstream: |
| 53 | + name: Downstream builds with Python ${{ matrix.python-version }} |
| 54 | + runs-on: ubuntu-latest |
| 55 | + strategy: |
| 56 | + fail-fast: false |
| 57 | + matrix: |
| 58 | + python-version: ['2.7', '3.8'] |
| 59 | + |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v2 |
| 62 | + |
| 63 | + - name: Set up Python ${{ matrix.python-version }} |
| 64 | + uses: actions/setup-python@v2 |
| 65 | + with: |
| 66 | + python-version: ${{ matrix.python-version }} |
| 67 | + |
| 68 | + - name: Install tools |
| 69 | + run: pip install --upgrade -r tests/backend/downstream/requirements.txt |
| 70 | + |
| 71 | + - name: Build downstream projects |
| 72 | + run: python tests/backend/downstream/integrate.py |
| 73 | + |
| 74 | + response-time: |
| 75 | + name: CLI responsiveness with latest Python |
| 76 | + runs-on: ubuntu-latest |
| 77 | + |
| 78 | + env: |
| 79 | + PYTHON_VERSION: '3.10' |
| 80 | + HYPERFINE_VERSION: '1.12.0' |
| 81 | + |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v2 |
| 84 | + |
| 85 | + - name: Set up Python ${{ env.PYTHON_VERSION }} |
| 86 | + uses: actions/setup-python@v2 |
| 87 | + with: |
| 88 | + python-version: ${{ env.PYTHON_VERSION }} |
| 89 | + |
| 90 | + - name: Install hyperfine |
| 91 | + run: | |
| 92 | + wget https://github.com/sharkdp/hyperfine/releases/download/v${HYPERFINE_VERSION}/hyperfine_${HYPERFINE_VERSION}_amd64.deb |
| 93 | + sudo dpkg -i hyperfine_${HYPERFINE_VERSION}_amd64.deb |
| 94 | +
|
| 95 | + - name: Install other tools |
| 96 | + run: pip install --upgrade flit poetry pipenv |
| 97 | + |
| 98 | + - name: Install ourself |
| 99 | + run: pip install . |
| 100 | + |
| 101 | + - name: Benchmark |
| 102 | + run: | |
| 103 | + hyperfine -m 100 --warmup 10 -i pipenv |
| 104 | + hyperfine -m 100 --warmup 10 poetry |
| 105 | + hyperfine -m 100 --warmup 10 -i flit |
| 106 | + hyperfine -m 100 --warmup 10 hatch |
0 commit comments