File: tox.yml

package info (click to toggle)
subprocess-tee 0.4.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 172 kB
  • sloc: python: 266; makefile: 4
file content (87 lines) | stat: -rw-r--r-- 2,264 bytes parent folder | download | duplicates (3)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: tox

on:
  push:  # only publishes pushes to the main branch to TestPyPI
    branches:  # any integration branch but not tag
      - main
    tags-ignore:
      - "**"
  pull_request:

jobs:
  pre:
    name: pre
    runs-on: ubuntu-22.04
    outputs:
      matrix: ${{ steps.generate_matrix.outputs.matrix }}
    steps:
      - name: Determine matrix
        id: generate_matrix
        uses: coactions/dynamic-matrix@v1
        with:
          other_names: |
            lint
            docs
            pkg

  alpine:
    name: alpine
    runs-on: ubuntu-22.04
    steps:
      - name: Check out code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Run docker build
        run: docker build .

  unit:
    name: ${{ matrix.name }}
    runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
    needs: pre
    strategy:
      matrix: ${{ fromJson(needs.pre.outputs.matrix) }}
    steps:

    - uses: actions/checkout@main
      with:
        fetch-depth: 0

    - name: Set up stock Python ${{ matrix.python_version }} from GitHub
      uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python_version }}

    - name: Log the currently selected Python version info (${{ matrix.python_version }})
      run: |
        python --version --version
        which python

    - name: Pip cache
      uses: actions/cache@v4
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ env.PY_SHA256 }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('tox.ini') }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('pytest.ini') }}
        restore-keys: |
          ${{ runner.os }}-pip-
          ${{ runner.os }}-

    - name: Install tox
      run: |
          python -m pip install -U pip
          pip install tox
    - name: Run tox run -e ${{ matrix.passed_name }}
      run: tox run -e ${{ matrix.passed_name }}

  check: # This job does nothing and is only used for the branch protection
    if: always()
    needs:
      - unit
      - alpine
    runs-on: ubuntu-22.04
    steps:
      - name: Decide whether the needed jobs succeeded or failed
        uses: re-actors/alls-green@release/v1
        with:
          jobs: ${{ toJSON(needs) }}