From a3210ad762a5a8e55d071dcf596cbfaf2bfdd1d2 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Mon, 29 Jun 2020 17:04:43 +0100 Subject: [PATCH 1/7] Use GitHub Actions instead of Travis --- .github/workflows/test-gnofract4d.yml | 31 +++++++++++++++++++++++++++ tox.ini | 4 ++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test-gnofract4d.yml diff --git a/.github/workflows/test-gnofract4d.yml b/.github/workflows/test-gnofract4d.yml new file mode 100644 index 000000000..9160e5037 --- /dev/null +++ b/.github/workflows/test-gnofract4d.yml @@ -0,0 +1,31 @@ +name: Test Gnofract 4D + +on: push + +jobs: + test: + + runs-on: ubuntu-latest + strategy: + matrix: + python: [3.5, 3.6, 3.7] + toxenv: [py] + include: + - python: 3.7 + toxenv: pylint + + steps: + - uses: actions/checkout@v2 + - name: Install Ubuntu packages + # libgirepository1.0-dev required to build PyGObject from source + run: sudo apt install gir1.2-gtk-3.0 libgirepository1.0-dev xvfb + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Install Tox and any other PyPI packages + run: pip install tox + - name: Build + run: python setup.py build + - name: Run Tox + run: xvfb-run --auto-servernum tox -e ${{ matrix.toxenv }} diff --git a/tox.ini b/tox.ini index b97f11006..efe023a1a 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,8 @@ deps = pytest pytest-cov +skip_install = true + commands = pytest {posargs: --cov=fract4d --cov=fract4dgui --cov=fract4d_compiler fract4d fract4dgui fract4d_compiler test.py} @@ -17,6 +19,4 @@ deps = pylint pytest # imported by tests -skip_install = true - commands = {toxinidir}/bin/pylint.sh From 9b46d7b3829d3c85b7b5599dee4996bea429a700 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Mon, 29 Jun 2020 17:04:43 +0100 Subject: [PATCH 2/7] Add pull_request event --- .github/workflows/test-gnofract4d.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-gnofract4d.yml b/.github/workflows/test-gnofract4d.yml index 9160e5037..34c1919b8 100644 --- a/.github/workflows/test-gnofract4d.yml +++ b/.github/workflows/test-gnofract4d.yml @@ -1,6 +1,9 @@ name: Test Gnofract 4D -on: push +on: + pull_request: + types: [opened, reopened, ready_for_review] + push: jobs: test: From 41a3efb6e35ddab7a840f2f45e8f1d1f7f5de5e9 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Mon, 29 Jun 2020 17:04:43 +0100 Subject: [PATCH 3/7] Upload to Codecov --- .github/workflows/test-gnofract4d.yml | 10 ++++++++++ tox.ini | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-gnofract4d.yml b/.github/workflows/test-gnofract4d.yml index 34c1919b8..64f48933a 100644 --- a/.github/workflows/test-gnofract4d.yml +++ b/.github/workflows/test-gnofract4d.yml @@ -17,6 +17,11 @@ jobs: - python: 3.7 toxenv: pylint + env: + # For labelling Codecov report + OS: ubuntu-latest + PYTHON: ${{ matrix.python }} + steps: - uses: actions/checkout@v2 - name: Install Ubuntu packages @@ -32,3 +37,8 @@ jobs: run: python setup.py build - name: Run Tox run: xvfb-run --auto-servernum tox -e ${{ matrix.toxenv }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1.0.7 + with: + file: ./coverage.xml + env_vars: OS,PYTHON diff --git a/tox.ini b/tox.ini index efe023a1a..28021c800 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ deps = skip_install = true commands = - pytest {posargs: --cov=fract4d --cov=fract4dgui --cov=fract4d_compiler fract4d fract4dgui fract4d_compiler test.py} + pytest {posargs: --cov=fract4d --cov=fract4dgui --cov=fract4d_compiler --cov-report=xml fract4d fract4dgui fract4d_compiler test.py} passenv = DISPLAY XAUTHORITY HOME From bfe1ae57eff2a59e0ed395641a33419372b2eec8 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Mon, 29 Jun 2020 17:04:43 +0100 Subject: [PATCH 4/7] Add MacOS --- .github/workflows/test-gnofract4d.yml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-gnofract4d.yml b/.github/workflows/test-gnofract4d.yml index 64f48933a..13df1e47e 100644 --- a/.github/workflows/test-gnofract4d.yml +++ b/.github/workflows/test-gnofract4d.yml @@ -6,25 +6,36 @@ on: push: jobs: - test: + run: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [macos-latest, ubuntu-latest] python: [3.5, 3.6, 3.7] toxenv: [py] + exclude: + - os: macos-latest + python: 3.5 + - os: macos-latest + python: 3.6 include: - - python: 3.7 + - os: ubuntu-latest + python: 3.7 toxenv: pylint env: # For labelling Codecov report - OS: ubuntu-latest + OS: ${{ matrix.os }} PYTHON: ${{ matrix.python }} steps: - uses: actions/checkout@v2 + - name: Install MacOS packages + if: ${{ matrix.os == 'macos-latest' }} + run: brew install gtk+3 pygobject3 - name: Install Ubuntu packages + if: ${{ matrix.os == 'ubuntu-latest' }} # libgirepository1.0-dev required to build PyGObject from source run: sudo apt install gir1.2-gtk-3.0 libgirepository1.0-dev xvfb - name: Setup Python @@ -35,7 +46,11 @@ jobs: run: pip install tox - name: Build run: python setup.py build - - name: Run Tox + - name: Run Tox (MacOS) + if: ${{ matrix.os == 'macos-latest' }} + run: tox -e ${{ matrix.toxenv }} + - name: Run Tox (Linux) + if: ${{ matrix.os == 'ubuntu-latest' }} run: xvfb-run --auto-servernum tox -e ${{ matrix.toxenv }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v1.0.7 From a536e3b83cb34a7ef62e9b48037911b2b94978e1 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Mon, 29 Jun 2020 17:04:43 +0100 Subject: [PATCH 5/7] Use runner.os --- .github/workflows/test-gnofract4d.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-gnofract4d.yml b/.github/workflows/test-gnofract4d.yml index 13df1e47e..2f1e7fa37 100644 --- a/.github/workflows/test-gnofract4d.yml +++ b/.github/workflows/test-gnofract4d.yml @@ -32,10 +32,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install MacOS packages - if: ${{ matrix.os == 'macos-latest' }} + if: ${{ runner.os == 'macOS' }} run: brew install gtk+3 pygobject3 - name: Install Ubuntu packages - if: ${{ matrix.os == 'ubuntu-latest' }} + if: ${{ runner.os == 'Linux' }} # libgirepository1.0-dev required to build PyGObject from source run: sudo apt install gir1.2-gtk-3.0 libgirepository1.0-dev xvfb - name: Setup Python @@ -47,10 +47,10 @@ jobs: - name: Build run: python setup.py build - name: Run Tox (MacOS) - if: ${{ matrix.os == 'macos-latest' }} + if: ${{ runner.os == 'macOS' }} run: tox -e ${{ matrix.toxenv }} - name: Run Tox (Linux) - if: ${{ matrix.os == 'ubuntu-latest' }} + if: ${{ runner.os == 'Linux' }} run: xvfb-run --auto-servernum tox -e ${{ matrix.toxenv }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v1.0.7 From fc5f3e4c694fa74d580f284bb512f4a607a8dead Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Mon, 29 Jun 2020 17:04:43 +0100 Subject: [PATCH 6/7] Use every available OS --- .github/workflows/test-gnofract4d.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-gnofract4d.yml b/.github/workflows/test-gnofract4d.yml index 2f1e7fa37..b585ba228 100644 --- a/.github/workflows/test-gnofract4d.yml +++ b/.github/workflows/test-gnofract4d.yml @@ -11,15 +11,16 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, ubuntu-latest] - python: [3.5, 3.6, 3.7] + os: [macos-10.15, ubuntu-20.04] + python: [3.7] toxenv: [py] - exclude: - - os: macos-latest - python: 3.5 - - os: macos-latest - python: 3.6 include: + - os: ubuntu-18.04 + python: 3.6 + toxenv: py + - os: ubuntu-16.04 + python: 3.5 + toxenv: py - os: ubuntu-latest python: 3.7 toxenv: pylint From 2719ef351ca9a485fb076378ea25d1cfb6425494 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Tue, 30 Jun 2020 19:34:52 +0100 Subject: [PATCH 7/7] Don't upload to Codecov from a Pylint job --- .github/workflows/test-gnofract4d.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-gnofract4d.yml b/.github/workflows/test-gnofract4d.yml index b585ba228..06b8cedb8 100644 --- a/.github/workflows/test-gnofract4d.yml +++ b/.github/workflows/test-gnofract4d.yml @@ -54,6 +54,7 @@ jobs: if: ${{ runner.os == 'Linux' }} run: xvfb-run --auto-servernum tox -e ${{ matrix.toxenv }} - name: Upload coverage to Codecov + if: ${{ matrix.toxenv == 'py' }} uses: codecov/codecov-action@v1.0.7 with: file: ./coverage.xml