• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3
4name: Python Portpicker & Portserver
5
6on:
7  push:
8    branches:
9    - 'main'
10  pull_request:
11    branches:
12    - 'main'
13
14jobs:
15  build-ubuntu:
16
17    runs-on: ubuntu-latest
18    strategy:
19      fail-fast: false
20      matrix:
21        python-version: [3.6, 3.7, 3.8, 3.9, '3.10']
22
23    steps:
24      - uses: actions/checkout@v2
25      - name: Set up Python ${{ matrix.python-version }}
26        uses: actions/setup-python@v2
27        with:
28          python-version: ${{ matrix.python-version }}
29      - name: Install dependencies
30        run: |
31          python -m pip install --upgrade pip
32          pip install pytest tox
33          if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
34      - name: Test with tox
35        run: |
36          # Run tox using the version of Python in `PATH`
37          tox -e py
38
39  build-windows:
40
41    runs-on: windows-latest
42    strategy:
43      fail-fast: false
44      matrix:
45        python-version: [3.6, 3.7, 3.8, 3.9, '3.10']
46
47    steps:
48      - uses: actions/checkout@v2
49      - name: Set up Python ${{ matrix.python-version }}
50        uses: actions/setup-python@v2
51        with:
52          python-version: ${{ matrix.python-version }}
53      - name: Install dependencies
54        run: |
55          python -m pip install --upgrade pip
56          pip install pytest tox
57          if (Test-Path "requirements.txt") { pip install -r requirements.txt }
58      - name: Test with tox
59        run: |
60          # Run tox using the version of Python in `PATH`
61          tox -e py
62