Fix yaml for CI #blessed

This commit is contained in:
Andrew Brookins 2021-11-02 17:08:32 -07:00
parent 60dc986947
commit ca48b222f3

View file

@ -12,7 +12,7 @@ on:
- '[0-9].[0-9]+' - '[0-9].[0-9]+'
- 'update/pre-commit-autoupdate' - 'update/pre-commit-autoupdate'
schedule: schedule:
- cron: '0 6 * * *' # Daily 6AM UTC build - cron: '0 6 * * *' # Daily 6AM UTC build
jobs: jobs:
@ -22,57 +22,57 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2.3.5 uses: actions/checkout@v2.3.5
- name: Setup Python 3.9 - name: Setup Python 3.9
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.9 python-version: 3.9
#---------------------------------------------- #----------------------------------------------
# ----- install & configure poetry ----- # ----- install & configure poetry -----
#---------------------------------------------- #----------------------------------------------
- name: Install Poetry - name: Install Poetry
uses: snok/install-poetry@v1 uses: snok/install-poetry@v1
with: with:
virtualenvs-create: true virtualenvs-create: true
virtualenvs-in-project: true virtualenvs-in-project: true
installer-parallel: true installer-parallel: true
#---------------------------------------------- #----------------------------------------------
# load cached venv if cache exists # load cached venv if cache exists
#---------------------------------------------- #----------------------------------------------
- name: Load cached venv - name: Load cached venv
id: cached-poetry-dependencies id: cached-poetry-dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: .venv path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
#---------------------------------------------- #----------------------------------------------
# install dependencies if cache does not exist # install dependencies if cache does not exist
#---------------------------------------------- #----------------------------------------------
- name: Install dependencies - name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root run: poetry install --no-interaction --no-root
#---------------------------------------------- #----------------------------------------------
# install your root project, if required # install your root project, if required
#---------------------------------------------- #----------------------------------------------
- name: Install library - name: Install library
run: poetry install --no-interaction run: poetry install --no-interaction
#---------------------------------------------- #----------------------------------------------
# run test suite # run test suite
#---------------------------------------------- #----------------------------------------------
- name: Run linter - name: Run linter
run: | run: |
make dist make dist
make lint make lint
test-unix: test-unix:
name: Test Unix name: Test Unix
needs: lint needs: lint
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest] os: [ ubuntu-latest ]
pyver: [3.6, 3.7, 3.8, 3.9, pypy3] pyver: [ 3.6, 3.7, 3.8, 3.9, pypy3 ]
redismod: ["preview"] # Removed "edge" because it's broken currently redismod: [ "preview" ] # Removed "edge" because it's broken currently
fail-fast: false fail-fast: false
services: services:
redis: redis:
@ -92,96 +92,95 @@ jobs:
OS: ${{ matrix.os }} OS: ${{ matrix.os }}
INSTALL_DIR: ${{ github.workspace }}/redis INSTALL_DIR: ${{ github.workspace }}/redis
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2.3.5 uses: actions/checkout@v2.3.5
- name: Setup Python ${{ matrix.pyver }} - name: Setup Python ${{ matrix.pyver }}
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.pyver }} python-version: ${{ matrix.pyver }}
#---------------------------------------------- #----------------------------------------------
# ----- install & configure poetry ----- # ----- install & configure poetry -----
#---------------------------------------------- #----------------------------------------------
- name: Install Poetry - name: Install Poetry
uses: snok/install-poetry@v1 uses: snok/install-poetry@v1
with: with:
virtualenvs-create: true virtualenvs-create: true
virtualenvs-in-project: true virtualenvs-in-project: true
installer-parallel: true installer-parallel: true
#---------------------------------------------- #----------------------------------------------
# load cached venv if cache exists # load cached venv if cache exists
#---------------------------------------------- #----------------------------------------------
- name: Load cached venv - name: Load cached venv
id: cached-poetry-dependencies id: cached-poetry-dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: .venv path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
#---------------------------------------------- #----------------------------------------------
# install dependencies if cache does not exist # install dependencies if cache does not exist
#---------------------------------------------- #----------------------------------------------
- name: Install dependencies - name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root run: poetry install --no-interaction --no-root
#---------------------------------------------- #----------------------------------------------
# install your root project, if required # install your root project, if required
#---------------------------------------------- #----------------------------------------------
- name: Install library - name: Install library
run: poetry install --no-interaction run: poetry install --no-interaction
- name: Run unittests (redismod:${{ matrix.redismod }}, ${{ matrix.os }}) - name: Run unittests (redismod:${{ matrix.redismod }}, ${{ matrix.os }})
run: | run: |
make test make test
poetry run coverage xml poetry run coverage xml
- name: Upload coverage - name: Upload coverage
uses: codecov/codecov-action@v2.1.0 uses: codecov/codecov-action@v2.1.0
with: with:
file: ./coverage.xml file: ./coverage.xml
flags: unit flags: unit
env_vars: OS env_vars: OS
fail_ci_if_error: false fail_ci_if_error: false
deploy: deploy:
name: Deploy name: Deploy
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: test-unix needs: test-unix
# Run only on pushing a tag # Run only on pushing a tag
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2.3.5 uses: actions/checkout@v2.3.5
- name: Setup Python 3.9 - name: Setup Python 3.9
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.9 python-version: 3.9
- name: Install Poetry
- name: Install Poetry uses: snok/install-poetry@v1
uses: snok/install-poetry@v1 with:
with: virtualenvs-create: true
virtualenvs-create: true virtualenvs-in-project: true
virtualenvs-in-project: true installer-parallel: true
installer-parallel: true #----------------------------------------------
#---------------------------------------------- # load cached venv if cache exists
# load cached venv if cache exists #----------------------------------------------
#---------------------------------------------- - name: Load cached venv
- name: Load cached venv id: cached-poetry-dependencies
id: cached-poetry-dependencies uses: actions/cache@v2
uses: actions/cache@v2 with:
with: path: .venv
path: .venv key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} #----------------------------------------------
#---------------------------------------------- # install dependencies if cache does not exist
# install dependencies if cache does not exist #----------------------------------------------
#---------------------------------------------- - name: Install dependencies
- name: Install dependencies if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root
run: poetry install --no-interaction --no-root #----------------------------------------------
#---------------------------------------------- # install your root project, if required
# install your root project, if required #----------------------------------------------
#---------------------------------------------- - name: Install library
- name: Install library run: poetry install --no-interaction
run: poetry install --no-interaction - name: PyPI upload
- name: PyPI upload env:
env: TWINE_USERNAME: __token__
TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: |
run: | make upload
make upload