Skip to content

Commit

Permalink
Refactor workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
thombashi committed Oct 2, 2021
1 parent 1a4b734 commit e703f86
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,33 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install pip
id: install-pip
run: |
python -m pip install --upgrade "pip>=21.1"
run: python -m pip install --upgrade --disable-pip-version-check "pip>=21.1"

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
run: echo "::set-output name=dir::$(pip cache dir)"

- name: Cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
path: |
${{ steps.pip-cache.outputs.dir }}
./.tox
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade tox
run: make setup-ci

- name: Lint
run: |
make check
run: make check

unit-test:
runs-on: ${{ matrix.os }}
Expand All @@ -63,32 +60,30 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install pip
id: install-pip
run: |
python -m pip install --upgrade "pip>=21.1"
run: python -m pip install --upgrade --disable-pip-version-check "pip>=21.1"

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
run: echo "::set-output name=dir::$(pip cache dir)"

- name: Cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
path: |
${{ steps.pip-cache.outputs.dir }}
./.tox
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-pip-
- name: Install dependencies
run: |
make setup
run: make setup-ci

- name: Run tests
run: |
Expand All @@ -97,7 +92,7 @@ jobs:
- name: Upload coverage report
run: |
python -m pip install --upgrade coveralls
python -m pip install --upgrade --disable-pip-version-check coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit e703f86

Please sign in to comment.