From 55cbd1cbc28b93673f73818639614c61c18f07d1 Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Mon, 25 Jan 2021 22:03:40 +0100 Subject: [PATCH 1/9] chore: move .env into docker-compose dir --- .renovaterc.json | 2 +- .env => tools/functional/fixtures/.env | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename .env => tools/functional/fixtures/.env (100%) diff --git a/.renovaterc.json b/.renovaterc.json index 037a97e1a..b46c8f4cb 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -4,7 +4,7 @@ ], "regexManagers": [ { - "fileMatch": ["^.env$"], + "fileMatch": ["^tools/functional/fixtures/.env$"], "matchStrings": ["GITLAB_TAG=(?.*?)\n"], "depNameTemplate": "gitlab/gitlab-ce", "datasourceTemplate": "docker", diff --git a/.env b/tools/functional/fixtures/.env similarity index 100% rename from .env rename to tools/functional/fixtures/.env From 8bb73a3440b79df93c43214c31332ad47ab286d8 Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Tue, 26 Jan 2021 23:30:52 +0100 Subject: [PATCH 2/9] chore(ci): replace travis with Actions --- .github/workflows/lint.yml | 20 +++++++ .github/workflows/test.yml | 45 ++++++++++++++++ .travis.yml | 108 ------------------------------------- 3 files changed, 65 insertions(+), 108 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..10d7ae559 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,20 @@ +name: Lint + +on: [push, pull_request] + +jobs: + black: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: psf/black@stable + with: + black_args: ". --check" + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: wagoid/commitlint-github-action@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..ef35986ac --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,45 @@ +name: Test + +on: [push, pull_request] + +jobs: + unit: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - python-version: 3.6 + toxenv: py36 + - python-version: 3.7 + toxenv: py37 + - python-version: 3.8 + toxenv: py38 + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: pip install tox + - name: Run tests + env: + TOXENV: ${{ matrix.toxenv }} + run: tox + functional: + runs-on: ubuntu-latest + strategy: + matrix: + toxenv: [py_func_v4, py_func_cli] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: pip install tox + - name: Run tests + env: + TOXENV: ${{ matrix.toxenv }} + run: tox diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 09359b5aa..000000000 --- a/.travis.yml +++ /dev/null @@ -1,108 +0,0 @@ -sudo: required -services: - - docker -language: python - -git: - depth: false - -stages: - - lint - - test - -jobs: - include: - - stage: lint - name: commitlint - python: 3.8 - script: - - pip3 install pre-commit - - pre-commit run --hook-stage manual commitlint-travis - cache: - directories: - - $HOME/.cache/pre-commit - - stage: lint - name: black_lint - dist: bionic - python: 3.8 - script: - - pip3 install -U --pre black==20.8b1 - - black --check . - - stage: test - name: cli_func_v4 - dist: bionic - python: 3.8 - script: - - pip3 install tox - - tox -e cli_func_v4 - - stage: test - name: py_func_v4 - dist: bionic - python: 3.8 - script: - - pip3 install tox - - tox -e py_func_v4 - - stage: test - name: cli_func_nightly - dist: bionic - python: 3.8 - env: GITLAB_TAG=nightly - script: - - pip3 install tox - - tox -e cli_func_v4 - - stage: test - name: py_func_nightly - dist: bionic - python: 3.8 - env: GITLAB_TAG=nightly - script: - - pip3 install tox - - tox -e py_func_v4 - - stage: test - name: docs - dist: bionic - python: 3.8 - script: - - pip3 install tox - - tox -e docs - - stage: test - name: py36 - python: 3.6 - dist: bionic - script: - - pip3 install tox - - tox -e py36 - - stage: test - name: py37 - dist: bionic - python: 3.7 - script: - - pip3 install tox - - tox -e py37 - - stage: test - dist: bionic - name: py38 - python: 3.8 - script: - - pip3 install tox - - tox -e py38 - - stage: test - dist: bionic - name: twine-check - python: 3.8 - script: - - pip3 install tox wheel - - python3 setup.py sdist bdist_wheel - - tox -e twine-check - - stage: test - dist: bionic - name: coverage - python: 3.8 - install: - - pip3 install tox codecov - script: - - tox -e cover - after_success: - - codecov - allow_failures: - - env: GITLAB_TAG=nightly From 8f9223041481976522af4c4f824ad45e66745f29 Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Tue, 26 Jan 2021 23:33:28 +0100 Subject: [PATCH 3/9] chore(ci): add pytest PR annotations --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef35986ac..4be5601b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: pip install tox + run: pip install tox pytest-github-actions-annotate-failures - name: Run tests env: TOXENV: ${{ matrix.toxenv }} @@ -38,7 +38,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: pip install tox + run: pip install tox pytest-github-actions-annotate-failures - name: Run tests env: TOXENV: ${{ matrix.toxenv }} From c6241e791357d3f90e478c456cc6d572b388e6d1 Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Tue, 26 Jan 2021 23:39:57 +0100 Subject: [PATCH 4/9] chore(ci): fix copy/paste oopsie --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4be5601b4..e00d33dfc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,10 +33,10 @@ jobs: toxenv: [py_func_v4, py_func_cli] steps: - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v2 with: - python-version: ${{ matrix.python-version }} + python-version: 3.8 - name: Install dependencies run: pip install tox pytest-github-actions-annotate-failures - name: Run tests From 5e1547a06709659c75d40a05ac924c51caffcccf Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Tue, 26 Jan 2021 23:51:19 +0100 Subject: [PATCH 5/9] chore(ci): fix typo in matrix --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e00d33dfc..b7db6f2c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - toxenv: [py_func_v4, py_func_cli] + toxenv: [py_func_v4, cli_func_v4] steps: - uses: actions/checkout@v2 - name: Set up Python From cfa27ac6453f20e1d1f33973aa8cbfccff1d6635 Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Tue, 26 Jan 2021 23:51:50 +0100 Subject: [PATCH 6/9] chore(ci): pin os version --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b7db6f2c1..f8b108b47 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: unit: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: include: @@ -27,7 +27,7 @@ jobs: TOXENV: ${{ matrix.toxenv }} run: tox functional: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: toxenv: [py_func_v4, cli_func_v4] From 1f7a2ab5bd620b06eb29146e502e46bd47432821 Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Wed, 27 Jan 2021 00:19:22 +0100 Subject: [PATCH 7/9] chore(ci): pin docker-compose install for tests This ensures python-dotenv with expected behavior for .env processing --- docker-requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-requirements.txt b/docker-requirements.txt index 1bcd74b6e..b7a333358 100644 --- a/docker-requirements.txt +++ b/docker-requirements.txt @@ -1,4 +1,5 @@ -r requirements.txt -r test-requirements.txt +docker-compose==1.28.2 # prevent inconsistent .env behavior from system install pytest-console-scripts pytest-docker From 150207908a72869869d161ecb618db141e3a9348 Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Wed, 27 Jan 2021 00:22:13 +0100 Subject: [PATCH 8/9] chore(ci): force colors in pytest runs --- .github/workflows/lint.yml | 3 +++ .github/workflows/test.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 10d7ae559..535fa011f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,6 +2,9 @@ name: Lint on: [push, pull_request] +env: + PY_COLORS: 1 + jobs: black: runs-on: ubuntu-latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f8b108b47..2a666acea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,9 @@ name: Test on: [push, pull_request] +env: + PY_COLORS: 1 + jobs: unit: runs-on: ubuntu-20.04 From 2de64cfa469c9d644a2950d3a4884f622ed9faf4 Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Wed, 27 Jan 2021 01:29:24 +0100 Subject: [PATCH 9/9] chore(ci): add coverage and docs jobs --- .github/workflows/docs.yml | 39 ++++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 23 ++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..04f47b616 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,39 @@ +name: Docs + +on: [push, pull_request] + +env: + PY_COLORS: 1 + +jobs: + sphinx: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + run: pip install tox + - name: Build docs + env: + TOXENV: docs + run: tox + + twine-check: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + run: pip install tox twine wheel + - name: Check twine readme rendering + env: + TOXENV: twine-check + run: | + python3 setup.py sdist bdist_wheel + tox diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a666acea..44708d397 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,7 @@ jobs: env: TOXENV: ${{ matrix.toxenv }} run: tox + functional: runs-on: ubuntu-20.04 strategy: @@ -46,3 +47,25 @@ jobs: env: TOXENV: ${{ matrix.toxenv }} run: tox + + coverage: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + run: pip install tox pytest-github-actions-annotate-failures + - name: Run tests + env: + PY_COLORS: 1 + TOXENV: cover + run: tox + - name: Upload codecov coverage + uses: codecov/codecov-action@v1 + with: + files: ./coverage.xml + flags: unit + fail_ci_if_error: true