Skip to content

Commit 961e7a4

Browse files
authored
CI Updates (#55)
1 parent 9f5237a commit 961e7a4

File tree

5 files changed

+37
-87
lines changed

5 files changed

+37
-87
lines changed

.github/workflows/coverage.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,24 @@ jobs:
2121
python-version: [3.7]
2222

2323
steps:
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v3
2525

2626
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v1
27+
uses: actions/setup-python@v4
2828
with:
2929
python-version: ${{ matrix.python-version }}
30+
cache: 'pip'
31+
cache-dependency-path: '**/setup.py'
3032

3133
- name: Get full Python version
3234
id: full-python-version
3335
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
3436

35-
- name: Set up cache
36-
uses: actions/cache@v2
37-
id: cache
38-
with:
39-
path: .venv
40-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}
41-
42-
- name: Ensure cache is healthy
43-
if: steps.cache.outputs.cache-hit == 'true'
44-
run: pip --version >/dev/null 2>&1 || rm -rf .venv
45-
4637
- name: Upgrade pip, setuptools and wheel
47-
run: |
48-
python -m pip install --upgrade pip
49-
pip install setuptools wheel
38+
run: python -m pip install --upgrade pip setuptools wheel
39+
5040
- name: Install package
51-
run: pip install '.[test]'
41+
run: python -m pip install '.[test]'
5242

5343
- name: Set up env for CodeClimate (push)
5444
run: |
@@ -71,6 +61,7 @@ jobs:
7161
curl -LSs 'https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64' >./cc-test-reporter;
7262
chmod +x ./cc-test-reporter
7363
./cc-test-reporter before-build
64+
7465
- name: Run all tests
7566
run: python -m pytest --cov-report xml --cov=generic_parser
7667

.github/workflows/cron.yml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,24 @@ jobs:
2020
python-version: [3.7, 3.8, 3.9, "3.10", 3.x] # crons should always run latest python hence 3.x
2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2424

2525
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v1
26+
uses: actions/setup-python@v4
2727
with:
2828
python-version: ${{ matrix.python-version }}
29+
cache: 'pip'
30+
cache-dependency-path: '**/setup.py'
2931

3032
- name: Get full Python version
3133
id: full-python-version
3234
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
3335

34-
- name: Set up cache
35-
uses: actions/cache@v2
36-
id: cache
37-
with:
38-
path: .venv
39-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}
40-
41-
- name: Ensure cache is healthy
42-
if: steps.cache.outputs.cache-hit == 'true'
43-
run: pip --version >/dev/null 2>&1 || rm -rf .venv
44-
4536
- name: Upgrade pip, setuptools and wheel
46-
run: |
47-
python -m pip install --upgrade pip
48-
pip install setuptools wheel
37+
run: python -m pip install --upgrade pip setuptools wheel
38+
4939
- name: Install package
50-
run: pip install '.[test]'
40+
run: python -m pip install '.[test]'
5141

5242
- name: Run all tests
5343
run: python -m pytest

.github/workflows/documentation.yml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,24 @@ jobs:
2020
python-version: [3.7]
2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2424

2525
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v1
26+
uses: actions/setup-python@v4
2727
with:
2828
python-version: ${{ matrix.python-version }}
29+
cache: 'pip'
30+
cache-dependency-path: '**/setup.py'
2931

3032
- name: Get full Python version
3133
id: full-python-version
3234
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
3335

34-
- name: Set up cache
35-
uses: actions/cache@v2
36-
id: cache
37-
with:
38-
path: .venv
39-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}
40-
41-
- name: Ensure cache is healthy
42-
if: steps.cache.outputs.cache-hit == 'true'
43-
run: pip --version >/dev/null 2>&1 || rm -rf .venv
44-
4536
- name: Upgrade pip, setuptools and wheel
46-
run: |
47-
python -m pip install --upgrade pip
48-
pip install setuptools wheel twine
37+
run: python -m pip install --upgrade pip setuptools wheel
38+
4939
- name: Install package
50-
run: pip install '.[doc]'
40+
run: python -m pip install '.[doc]'
5141

5242
- name: Build documentation
5343
run: python -m sphinx -b html doc ./doc_build -d ./doc_build

.github/workflows/publish.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,31 @@ jobs:
2020

2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2424

2525
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v1
26+
uses: actions/setup-python@v4
2727
with:
2828
python-version: ${{ matrix.python-version }}
29+
cache: 'pip'
30+
cache-dependency-path: '**/setup.py'
2931

3032
- name: Get full Python version
3133
id: full-python-version
3234
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
3335

34-
- name: Set up cache
35-
uses: actions/cache@v2
36-
id: cache
37-
with:
38-
path: .venv
39-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}
40-
41-
- name: Ensure cache is healthy
42-
if: steps.cache.outputs.cache-hit == 'true'
43-
run: pip --version >/dev/null 2>&1 || rm -rf .venv
36+
- name: Upgrade pip, setuptools, wheel, build and twine
37+
run: python -m pip install --upgrade pip setuptools wheel build twine
4438

45-
- name: Upgrade pip, setuptools and wheel
46-
run: |
47-
python -m pip install --upgrade pip
48-
pip install setuptools wheel build twine
4939
- name: Build and check build
5040
run: |
5141
python -m build
5242
twine check dist/*
53-
- name: Build and publish
43+
44+
- name: Publish
5445
if: ${{ success() }}
5546
env:
5647
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
5748
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
5849
run: |
59-
python -m build
60-
twine check dist/*
6150
twine upload dist/*

.github/workflows/tests.yml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,24 @@ jobs:
1919
python-version: [3.7, 3.8, 3.9, "3.10"]
2020

2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v3
2323

2424
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v1
25+
uses: actions/setup-python@v4
2626
with:
2727
python-version: ${{ matrix.python-version }}
28+
cache: 'pip'
29+
cache-dependency-path: '**/setup.py'
2830

2931
- name: Get full Python version
3032
id: full-python-version
3133
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
3234

33-
- name: Set up cache
34-
uses: actions/cache@v2
35-
id: cache
36-
with:
37-
path: .venv
38-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}
39-
40-
- name: Ensure cache is healthy
41-
if: steps.cache.outputs.cache-hit == 'true'
42-
run: pip --version >/dev/null 2>&1 || rm -rf .venv
43-
4435
- name: Upgrade pip, setuptools and wheel
45-
run: |
46-
python -m pip install --upgrade pip
47-
pip install setuptools wheel
36+
run: python -m pip install --upgrade pip setuptools wheel
37+
4838
- name: Install package
49-
run: pip install '.[test]'
39+
run: python -m pip install '.[test]'
5040

5141
- name: Run basic tests
5242
run: python -m pytest

0 commit comments

Comments
 (0)