From 28f35a71cdf6e31fd48de97a1d3e07333a3978b1 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 15 Nov 2024 08:59:05 -0500 Subject: [PATCH 1/6] Add GHA workflows Updates to use GitHub Actions and removes Travis CI support. --- .github/workflows/enforcer.yml | 16 +++++++++++++++ .github/workflows/pythonpublish.yml | 4 ++-- .github/workflows/tests.yml | 32 +++++++++++++++++++++++++++++ .travis.yml | 20 ------------------ README.md | 2 -- 5 files changed, 50 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/enforcer.yml create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/enforcer.yml b/.github/workflows/enforcer.yml new file mode 100644 index 0000000..1fc567f --- /dev/null +++ b/.github/workflows/enforcer.yml @@ -0,0 +1,16 @@ +name: 'Check Branch' + +on: + pull_request: + branches: + - base + +jobs: + check_branch: + runs-on: ubuntu-latest + steps: + - name: Check branch + if: github.head_ref != 'development' + run: | + echo "ERROR: You can only merge to base from the development branch." + exit 1 diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index d5f3859..ce25ff7 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -13,9 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..5de7adf --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,32 @@ +name: Test + +on: + pull_request: + branches: + - development + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10"] + toxenv: [py39, py310] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + + - name: Install tox + run: pip install tox + + - name: Run tox + run: tox + env: + TOXENV: ${{ matrix.toxenv }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 41a0818..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: python -dist: bionic -cache: pip - -before_script: - - pip install tox - -script: tox - -matrix: - include: - - - python: "3.9" - env: TOXENV=py39 - - - python: "3.10" - env: TOXENV=py310 - -notifications: - email: false diff --git a/README.md b/README.md index ad42799..2255c69 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ Helpers and common patterns used in Project Electron infrastructure. This package is named after a pattern or group of stars that is visually obvious, but not officially recognized as a constellation. Read more about asterisms on [Wikipedia](https://en.wikipedia.org/wiki/Asterism_(astronomy)). -[![Build Status](https://app.travis-ci.com/RockefellerArchiveCenter/asterism.svg?branch=base)](https://app.travis-ci.com/RockefellerArchiveCenter/asterism) - ## Setup Make sure this library is installed: From 72c13c56998c1b3830e36737202f512bbccd7511 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 15 Nov 2024 09:16:00 -0500 Subject: [PATCH 2/6] tweak tests Tweak tests to match py matrix with tox env --- .github/workflows/tests.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5de7adf..cef27f9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,6 @@ jobs: strategy: matrix: python-version: ["3.9", "3.10"] - toxenv: [py39, py310] steps: - name: Checkout code @@ -27,6 +26,10 @@ jobs: run: pip install tox - name: Run tox - run: tox + if: ${{ matrix.python-version }} == "3.9" + env: + TOXENV: py39 + if: ${{ matrix.python-version }} == "3.9" env: - TOXENV: ${{ matrix.toxenv }} + TOXENV: py310 + run: tox From 4ec47d43ec6c236133c7e986f2a7499ddee5a858 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 15 Nov 2024 09:17:37 -0500 Subject: [PATCH 3/6] fix tests fix tests --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cef27f9..c484bc6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,10 +25,12 @@ jobs: - name: Install tox run: pip install tox - - name: Run tox + - name: Run tox 3.9 if: ${{ matrix.python-version }} == "3.9" env: TOXENV: py39 + + - name Run tox 3.10 if: ${{ matrix.python-version }} == "3.9" env: TOXENV: py310 From cdf51f2ade1a70cb136b3b036d4891796f6c3d05 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 15 Nov 2024 09:18:25 -0500 Subject: [PATCH 4/6] fix typo fixes test workflow typo --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c484bc6..7d56303 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,7 +30,7 @@ jobs: env: TOXENV: py39 - - name Run tox 3.10 + - name: Run tox 3.10 if: ${{ matrix.python-version }} == "3.9" env: TOXENV: py310 From 6107eb20575030e09ad799f08a0dd6582bb0b43e Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 15 Nov 2024 09:19:40 -0500 Subject: [PATCH 5/6] update tests Try running tox without defining toxenv --- .github/workflows/tests.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7d56303..3d97a30 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,13 +25,5 @@ jobs: - name: Install tox run: pip install tox - - name: Run tox 3.9 - if: ${{ matrix.python-version }} == "3.9" - env: - TOXENV: py39 - - - name: Run tox 3.10 - if: ${{ matrix.python-version }} == "3.9" - env: - TOXENV: py310 + - name: Run tox run: tox From 4b899dbee7af38a5d58fa6697e657a99d60b15ca Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 15 Nov 2024 15:13:43 -0500 Subject: [PATCH 6/6] update tests removes python 3.9 from matrix --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3d97a30..7f1b15d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10"] + python-version: ["3.10"] steps: - name: Checkout code