From f97190698efd18f470a5773d98150faa75d5c494 Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Fri, 22 Jan 2021 16:31:14 +0100 Subject: [PATCH 1/6] Run Python 3.9 tests on Windows and Mac --- .github/workflows/tests.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2d1a3a6488..7120233f24 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,10 +11,9 @@ jobs: fail-fast: false matrix: include: - #- {name: Linux, python: '3.9', os: ubuntu-latest, tox: py39} - #- {name: Windows, python: '3.9', os: windows-latest, tox: py39} - #- {name: Mac, python: '3.9', os: macos-latest, tox: py39} - - {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39} + - {name: Linux, python: '3.9', os: ubuntu-latest, tox: py39} + - {name: Windows, python: '3.9', os: windows-latest, tox: py39} + - {name: Mac, python: '3.9', os: macos-latest, tox: py39} - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38} - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37} - {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36} From d0b77cc84cee6159e1d98b36d3b818f61ae4b1b4 Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Fri, 22 Jan 2021 16:55:43 +0100 Subject: [PATCH 2/6] Revert "Run Python 3.9 tests on Windows and Mac" This reverts commit f97190698efd18f470a5773d98150faa75d5c494. --- .github/workflows/tests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7120233f24..2d1a3a6488 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,9 +11,10 @@ jobs: fail-fast: false matrix: include: - - {name: Linux, python: '3.9', os: ubuntu-latest, tox: py39} - - {name: Windows, python: '3.9', os: windows-latest, tox: py39} - - {name: Mac, python: '3.9', os: macos-latest, tox: py39} + #- {name: Linux, python: '3.9', os: ubuntu-latest, tox: py39} + #- {name: Windows, python: '3.9', os: windows-latest, tox: py39} + #- {name: Mac, python: '3.9', os: macos-latest, tox: py39} + - {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39} - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38} - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37} - {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36} From 07e123eda7655b2a8fc2dd88a1285c736a6c2a6a Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Fri, 22 Jan 2021 17:01:46 +0100 Subject: [PATCH 3/6] Add Github Action job that builds Docker image (to verify that it's not broken) --- .github/workflows/tests.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2d1a3a6488..628e584b45 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,3 +42,14 @@ jobs: run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - run: pip install tox codecov - run: tox -e ${{ matrix.tox }} + + verify_docker_build: + name: Verify Docker image build + needs: tests + steps: + - uses: docker/build-push-action@v2 + with: + context: ./ + file: ./Dockerfile + push: false + tags: locustio/locust:latest From c6bf12112c66fabd165bb790b68394e610e5429e Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Fri, 22 Jan 2021 17:02:50 +0100 Subject: [PATCH 4/6] Add missing runs-on directive --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 628e584b45..68c2cf29b4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -46,6 +46,7 @@ jobs: verify_docker_build: name: Verify Docker image build needs: tests + runs-on: ubuntu-latest steps: - uses: docker/build-push-action@v2 with: From 3fdf29326c2fecef64c73747602b275a298f5b04 Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Fri, 22 Jan 2021 17:07:32 +0100 Subject: [PATCH 5/6] Add checkout action --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 68c2cf29b4..ebcf45c930 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,6 +48,7 @@ jobs: needs: tests runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 - uses: docker/build-push-action@v2 with: context: ./ From 3aec8ccbd57437362aea31d3dbfe6e0564915add Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Fri, 22 Jan 2021 19:20:35 +0100 Subject: [PATCH 6/6] Add Github Action job for creating PyPI releases --- .github/workflows/tests.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ebcf45c930..a43a3b8a0d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,3 +55,28 @@ jobs: file: ./Dockerfile push: false tags: locustio/locust:latest + + release: + name: Release to PyPI + needs: verify_docker_build + if: startsWith(github.event.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel + - name: Build + run: | + python setup.py sdist bdist_wheel + - name: Publish to PyPI (Test) + + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}