From 05d1fabba85e8d11f6faf7a12df9e797d7836931 Mon Sep 17 00:00:00 2001 From: Sahan Kumarasinghe Date: Sat, 22 Aug 2020 03:02:59 -0400 Subject: [PATCH 1/9] Added windows testing as GitHub workflow --- .circleci/config.yml | 33 ------------------ .github/workflows/tests.yml | 69 +++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 33 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/tests.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index b515088e..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,33 +0,0 @@ - -version: 2 -jobs: - build: - docker: - - image: circleci/python:3.6.1 - - working_directory: ~/repo - - steps: - - checkout - - run: - name: Level synthesis test - command: | - echo -e "y\n" | python3 ./make_level.py testlevel1 "Test Level 1" testskill "Test Skill" - echo -e "y\n" | python3 ./make_level.py testlevel2 "Test Level 2" testskill - - run: - name: Set up environment - command: | - pip3 install --user . - pip3 install --user pytest - pip3 install --user flake8 - git config --global user.name "CircleCI" - git config --global user.email "circleci@example.com" - - run: - name: Running tests - command: | - export PATH=$PATH:$HOME/.local/bin - python3 -m pytest gitgud - - run: - name: flake8 checks - command: | - python3 -m flake8 . diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..910d1a9e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,69 @@ +name: Run tests in environments + +on: + push: + + +jobs: + unix-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - uses: actions/setup-python@v2 + with: + python-version: '3.6.7' + + - name: Level synthesis test + run: | + echo -e "y\n" | python3 ./make_level.py testlevel1 "Test Level 1" testskill "Test Skill" + echo -e "y\n" | python3 ./make_level.py testlevel2 "Test Level 2" testskill + + - name: Set up environment + run: | + pip3 install . + pip3 install flake8 + pip3 install pytest + git config --global user.name "Github Actions" + git config --global user.email "action@github.com" + + - name: Run tests + run: python3 -m pytest gitgud + + - name: flake8 checks + run: python3 -m flake8 . + + win-test: + runs-on: windows-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - uses: actions/setup-python@v2 + with: + python-version: '3.6.7' + + - name: Level synthesis test + run: | + echo -e "y\n" | python ./make_level.py testlevel1 "Test Level 1" testskill "Test Skill" + echo -e "y\n" | python ./make_level.py testlevel2 "Test Level 2" testskill + + - name: Set up environment + run: | + pip install . + pip install flake8 + pip install pytest + git config --global user.name "Github Actions" + git config --global user.email "action@github.com" + + - name: Run tests + run: python -m pytest gitgud + + - name: flake8 checks + run: python -m flake8 . From 8bceceeff215cbe0b55a734c3a167930ce84c95d Mon Sep 17 00:00:00 2001 From: Sahan Kumarasinghe Date: Mon, 24 Aug 2020 18:01:49 -0400 Subject: [PATCH 2/9] Added macOS testing --- .github/workflows/tests.yml | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 910d1a9e..f7fcba92 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,11 +1,41 @@ -name: Run tests in environments +name: Run OS tests on: push: jobs: - unix-test: + macos-test: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - uses: actions/setup-python@v2 + with: + python-version: '3.6.7' + + - name: Level synthesis test + run: | + echo -e "y\n" | python3 ./make_level.py testlevel1 "Test Level 1" testskill "Test Skill" + echo -e "y\n" | python3 ./make_level.py testlevel2 "Test Level 2" testskill + + - name: Set up environment + run: | + pip3 install . + pip3 install flake8 + pip3 install pytest + git config --global user.name "Github Actions" + git config --global user.email "action@github.com" + + - name: Run tests + run: python3 -m pytest gitgud + + - name: flake8 checks + run: python3 -m flake8 . + + linux-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 611ab6afcbb6798f5d1d119309bcc00175f358cd Mon Sep 17 00:00:00 2001 From: Sahan Kumarasinghe Date: Mon, 24 Aug 2020 19:36:42 -0400 Subject: [PATCH 3/9] Make sure the shell is running with bash --- .github/workflows/tests.yml | 67 +++++-------------------------------- 1 file changed, 8 insertions(+), 59 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f7fcba92..626c962f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,65 +5,14 @@ on: jobs: - macos-test: - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 1 - - - uses: actions/setup-python@v2 - with: - python-version: '3.6.7' - - - name: Level synthesis test - run: | - echo -e "y\n" | python3 ./make_level.py testlevel1 "Test Level 1" testskill "Test Skill" - echo -e "y\n" | python3 ./make_level.py testlevel2 "Test Level 2" testskill - - - name: Set up environment - run: | - pip3 install . - pip3 install flake8 - pip3 install pytest - git config --global user.name "Github Actions" - git config --global user.email "action@github.com" - - - name: Run tests - run: python3 -m pytest gitgud - - - name: flake8 checks - run: python3 -m flake8 . - - linux-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 1 - - - uses: actions/setup-python@v2 - with: - python-version: '3.6.7' - - - name: Level synthesis test - run: | - echo -e "y\n" | python3 ./make_level.py testlevel1 "Test Level 1" testskill "Test Skill" - echo -e "y\n" | python3 ./make_level.py testlevel2 "Test Level 2" testskill - - - name: Set up environment - run: | - pip3 install . - pip3 install flake8 - pip3 install pytest - git config --global user.name "Github Actions" - git config --global user.email "action@github.com" - - - name: Run tests - run: python3 -m pytest gitgud - - - name: flake8 checks - run: python3 -m flake8 . + tests: + runs-on: ${{ matrix.platform }} + strategy: + matrix: + platform: [ubuntu-latest, macos-latest, windows-latest] + defaults: + run: + shell: bash win-test: runs-on: windows-latest From 4b44217dc702465d564c1eebb2e3398b3e76504b Mon Sep 17 00:00:00 2001 From: Sahan Kumarasinghe Date: Mon, 24 Aug 2020 19:56:23 -0400 Subject: [PATCH 4/9] Run tests even if previuos ones errored --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 626c962f..de52199e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,6 +8,7 @@ jobs: tests: runs-on: ${{ matrix.platform }} strategy: + fail-fast: false matrix: platform: [ubuntu-latest, macos-latest, windows-latest] defaults: @@ -34,6 +35,7 @@ jobs: echo -e "y\n" | python ./make_level.py testlevel2 "Test Level 2" testskill - name: Set up environment + if: ${{ always() }} run: | pip install . pip install flake8 @@ -45,4 +47,5 @@ jobs: run: python -m pytest gitgud - name: flake8 checks + if: ${{ always() }} run: python -m flake8 . From 79c9b5dffaad2be44a11c271aa71d6e6e526b9e1 Mon Sep 17 00:00:00 2001 From: Ben Thayer Date: Mon, 24 Aug 2020 19:25:43 -0500 Subject: [PATCH 5/9] Run test on pull request to master --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index de52199e..949ffe9b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,6 +2,9 @@ name: Run OS tests on: push: + branches: [ master ] + pull_request: + branches: [ master ] jobs: From cc309b516c1ad7164d9a14c0137a626acc434570 Mon Sep 17 00:00:00 2001 From: Ben Thayer Date: Mon, 24 Aug 2020 19:38:44 -0500 Subject: [PATCH 6/9] Reorganize tests --- .github/workflows/tests.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 949ffe9b..a36fca09 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,23 +32,25 @@ jobs: with: python-version: '3.6.7' - - name: Level synthesis test - run: | - echo -e "y\n" | python ./make_level.py testlevel1 "Test Level 1" testskill "Test Skill" - echo -e "y\n" | python ./make_level.py testlevel2 "Test Level 2" testskill - - name: Set up environment - if: ${{ always() }} run: | - pip install . pip install flake8 pip install pytest git config --global user.name "Github Actions" git config --global user.email "action@github.com" + - name: Synthesize level + run: | + echo -e "y\n" | python ./make_level.py testlevel1 "Test Level 1" testskill "Test Skill" + echo -e "y\n" | python ./make_level.py testlevel2 "Test Level 2" testskill + + - name: Install Git Gud + run: | + pip install . + - name: Run tests run: python -m pytest gitgud - - name: flake8 checks + - name: Check flake8 if: ${{ always() }} run: python -m flake8 . From a6132d7d0559cac44e595f8483b9e4b19ee9f6ba Mon Sep 17 00:00:00 2001 From: Sahan Kumarasinghe Date: Mon, 24 Aug 2020 21:00:35 -0400 Subject: [PATCH 7/9] Run tests on push for all branches --- .github/workflows/tests.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a36fca09..d475d4bd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,7 +2,6 @@ name: Run OS tests on: push: - branches: [ master ] pull_request: branches: [ master ] @@ -18,11 +17,6 @@ jobs: run: shell: bash - win-test: - runs-on: windows-latest - defaults: - run: - shell: bash steps: - uses: actions/checkout@v2 with: From ed05bde3f4f53751432f5820abe17f2df6af96ef Mon Sep 17 00:00:00 2001 From: Sahan Kumarasinghe Date: Sat, 29 Aug 2020 18:26:24 -0400 Subject: [PATCH 8/9] Move style checks into separate workflow --- .../{tests.yml => functional-tests.yml} | 5 ---- .github/workflows/style.yml | 27 +++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) rename .github/workflows/{tests.yml => functional-tests.yml} (89%) create mode 100644 .github/workflows/style.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/functional-tests.yml similarity index 89% rename from .github/workflows/tests.yml rename to .github/workflows/functional-tests.yml index d475d4bd..290fd811 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/functional-tests.yml @@ -28,7 +28,6 @@ jobs: - name: Set up environment run: | - pip install flake8 pip install pytest git config --global user.name "Github Actions" git config --global user.email "action@github.com" @@ -44,7 +43,3 @@ jobs: - name: Run tests run: python -m pytest gitgud - - - name: Check flake8 - if: ${{ always() }} - run: python -m flake8 . diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 00000000..652b8307 --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,27 @@ +name: Check PEP8 + +on: + push: + pull_request: + branches: [ master ] + + +jobs: + tests: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - uses: actions/setup-python@v2 + with: + python-version: '3.6.7' + + - name: Set up environment + run: | + pip install flake8 + + - name: Check flake8 + run: python -m flake8 . From 223f8b5cbcd0de9c8758a2a16b9bb7a775c5d8b6 Mon Sep 17 00:00:00 2001 From: Sahan Kumarasinghe Date: Sun, 6 Sep 2020 16:01:56 -0400 Subject: [PATCH 9/9] Lock GitPython at version 3.1.7 for windows compat. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 36fc0207..25ab7df2 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ }, python_requires='>=3.6', install_requires=[ - 'gitpython', + 'gitpython==3.1.7', 'importlib_resources', 'pyyaml', ],