From 60f1e4f66162a9d8729cc6f91f8e6db4f6ebddb4 Mon Sep 17 00:00:00 2001 From: Jussi Kukkonen Date: Tue, 9 Feb 2021 15:43:07 +0200 Subject: [PATCH 1/4] Add initial Github Actions CI workflow Windows is disabled since there are multiple failures currently. The special cases (purepy27, purepy38, py27-no-gpg, py38-no-gpg) are not handled. Coveralls is not integrated. --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..db02de1a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: Run Securesystemslib tests + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + strategy: + fail-fast: false + # Run tests on each OS/Python combination + matrix: + python-version: [2.7, 3.6, 3.7, 3.8, 3.9] + # TODO: Add windows-latest when gpg issues are solved + os: [ubuntu-latest, macos-latest] + toxenv: [py] + + # TODO add special cases: purepy27, purepy38, py27-no-gpg, py38-no-gpg + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout securesystemslib + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Find pip cache dir + id: pip-cache + run: echo "::set-output name=dir::$(pip cache dir)" + + - name: pip cache + uses: actions/cache@v2 + with: + # Use the os dependent pip cache directory found above + path: ${{ steps.pip-cache.outputs.dir }} + # A match with 'key' counts as cache hit + key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }} + # A match with 'restore-keys' is used as fallback + restore-keys: ${{ runner.os }}-pip- + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade tox + + - name: Run tox + run: tox -e ${{ matrix.toxenv }} + From 3c7f65d2f2ced05a457a5c92e8756b97d2f0c58e Mon Sep 17 00:00:00 2001 From: Jussi Kukkonen Date: Wed, 10 Feb 2021 10:45:39 +0200 Subject: [PATCH 2/4] GH Action: Add missing tox environments Use the recently added GNUPG env variable to hide gpg. --- .github/workflows/ci.yml | 14 +++++++++++++- tox.ini | 8 +++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db02de1a..d4138dff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,19 @@ jobs: os: [ubuntu-latest, macos-latest] toxenv: [py] - # TODO add special cases: purepy27, purepy38, py27-no-gpg, py38-no-gpg + include: + - python-version: 2.7 + os: ubuntu-latest + toxenv: purepy27 + - python-version: 2.7 + os: ubuntu-latest + toxenv: py27-no-gpg + - python-version: 3.8 + os: ubuntu-latest + toxenv: purepy38 + - python-version: 3.8 + os: ubuntu-latest + toxenv: py38-no-gpg runs-on: ${{ matrix.os }} diff --git a/tox.ini b/tox.ini index 13311694..848e8e59 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py27, py36, py37, py38, py39 purepy27, purepy38 +envlist = py27, py36, py37, py38, py39, purepy27, purepy38, py27-no-gpg, py38-no-gpg skipsdist = True [testenv] @@ -34,12 +34,14 @@ deps = commands = python -m tests.check_public_interfaces -# Below test envs require manual removal of gpg on the host system (see -# .travis.yml) and are excluded from the default tox run [testenv:py27-no-gpg] +setenv = + GNUPG = nonexisting-gpg-for-testing commands = python -m tests.check_public_interfaces_gpg [testenv:py38-no-gpg] +setenv = + GNUPG = nonexisting-gpg-for-testing commands = python -m tests.check_public_interfaces_gpg From 48a2c7f65025429fd2de281d12ed552158ae186d Mon Sep 17 00:00:00 2001 From: Jussi Kukkonen Date: Thu, 11 Feb 2021 13:17:15 +0200 Subject: [PATCH 3/4] Remove mentions of Travis, update the build status badge Github Actions is the CI now, update the README accordingly --- .travis.yml | 37 ------------------------------------- MANIFEST.in | 1 - README.rst | 4 ++-- 3 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9533bcde..00000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -dist: xenial -language: python -cache: pip - -matrix: - include: - - python: "2.7" - env: TOXENV=py27 - - python: "2.7" - env: TOXENV=purepy27 - - python: "2.7" - env: TOXENV=py27-no-gpg - before_install: - - sudo apt-get remove -y --allow-remove-essential gnupg gnupg2 - - python: "3.6" - env: TOXENV=py36 - - python: "3.7" - env: TOXENV=py37 - - python: "3.8" - env: TOXENV=py38 - - python: "3.9" - env: TOXENV=py39 - - python: "3.8" - env: TOXENV=purepy38 - - python: "3.8" - env: TOXENV=py38-no-gpg - before_install: - - sudo apt-get remove -y --allow-remove-essential gnupg gnupg2 - -install: - - pip install -U tox coveralls - -script: - - tox - -after_success: - - coveralls diff --git a/MANIFEST.in b/MANIFEST.in index 38918fab..ed83574f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,7 +3,6 @@ include LICENSE # Add test config files to show how to run tests include tox.ini -include .travis.yml include requirements*.txt # Include all files under the tests directory (including test data) diff --git a/README.rst b/README.rst index 8d4c8758..e82632ef 100644 --- a/README.rst +++ b/README.rst @@ -1,8 +1,8 @@ Secure Systems Library ---------------------- -.. image:: https://travis-ci.com/secure-systems-lab/securesystemslib.svg?branch=master - :target: https://travis-ci.com/secure-systems-lab/securesystemslib +.. image:: https://github.com/secure-systems-lab/securesystemslib/workflows/Run%20Securesystemslib%20tests/badge.svg + :target: https://github.com/secure-systems-lab/securesystemslib/actions?query=workflow%3A%22Run+TUF+tests%22+branch%3Amaster .. image:: https://coveralls.io/repos/github/secure-systems-lab/securesystemslib/badge.svg?branch=master :target: https://coveralls.io/github/secure-systems-lab/securesystemslib?branch=master From 2fac3444ee210d3dc6d950d5f4d6b91e12eb0abe Mon Sep 17 00:00:00 2001 From: Lukas Puehringer Date: Thu, 11 Feb 2021 13:32:41 +0100 Subject: [PATCH 4/4] Temporarily remove coveralls badge Remove coveralls badge until publishing of coverage results on coveralls.io has been reinstated (see #325). --- README.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.rst b/README.rst index e82632ef..e8a425f5 100644 --- a/README.rst +++ b/README.rst @@ -4,9 +4,6 @@ Secure Systems Library .. image:: https://github.com/secure-systems-lab/securesystemslib/workflows/Run%20Securesystemslib%20tests/badge.svg :target: https://github.com/secure-systems-lab/securesystemslib/actions?query=workflow%3A%22Run+TUF+tests%22+branch%3Amaster -.. image:: https://coveralls.io/repos/github/secure-systems-lab/securesystemslib/badge.svg?branch=master - :target: https://coveralls.io/github/secure-systems-lab/securesystemslib?branch=master - .. image:: https://api.dependabot.com/badges/status?host=github&repo=secure-systems-lab/securesystemslib :target: https://api.dependabot.com/badges/status?host=github&repo=secure-systems-lab/securesystemslib