Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed May 25, 2022
1 parent e684720 commit fa33954
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 57 deletions.
53 changes: 22 additions & 31 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
name: Code style and test
name: Code style & unit tests

on:
push: {}
workflow_dispatch: {}

jobs:
unit-tests:
name: Code style & unit tests
runs-on: ubuntu-latest
env:
PIP_NO_CACHE_DIR: false
PIP_USER: 1
PYTHONUSERBASE: ${{ github.workspace }}/.cache/py-user-base
strategy:
max-parallel: 4
matrix:
Expand All @@ -21,46 +16,42 @@ jobs:
- "3.9"
- "3.10"
steps:
- name: Add PYTHONUSERBASE to PATH
id: add-pythonuserbase
- uses: actions/checkout@v3
- name: Set up Python for Poetry
uses: actions/setup-python@v3
with:
python-version: "${{ matrix.python-version }}"
- name: Install poetry
run: |
echo '${{ env.PYTHONUSERBASE }}/bin/' >> $GITHUB_PATH
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v2
python -m pip install poetry pip
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "${{ matrix.python-version }}"
cache: "poetry"
- name: Set up Node.js
id: node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "14"
- name: Cache packages
uses: actions/cache@v2
with:
path: ${{ env.PYTHONUSERBASE }}
key: ${{ steps.python.outputs.python-version }}-full-${{ secrets.CACHE_KEY }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ steps.python.outputs.python-version }}-full-${{ secrets.CACHE_KEY }}-
node-version: "16"
- name: Install dependencies
run: |
python -m pip install -U poetry pip wheel
poetry config virtualenvs.create false
poetry install -n
sudo npm install -g pyright
- name: Install Node.js dependencies
run: |
npm install -g pyright
- name: Code style
run: |
python -m black --check awscliv2
python -m isort -c awscliv2
poetry run black --check awscliv2
poetry run isort -c awscliv2
- name: Lint
run: |
python -m flake8 awscliv2
python -m pylint awscliv2
poetry run flake8 awscliv2
poetry run pylint awscliv2
- name: Typing
run: |
python -m mypy awscliv2
poetry run mypy awscliv2
npx pyright
- name: Test
run: |
python -m pytest
poetry run pytest
28 changes: 5 additions & 23 deletions .github/workflows/on_push_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,20 @@ on:

jobs:
coverage:
name: Coverage
runs-on: ubuntu-latest
env:
PIP_NO_CACHE_DIR: false
PIP_USER: 1
PYTHONUSERBASE: ${{ github.workspace }}/.cache/py-user-base
steps:
- name: Add PYTHONUSERBASE to PATH
id: add-pythonuserbase
run: |
echo '${{ env.PYTHONUSERBASE }}/bin/' >> $GITHUB_PATH
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
id: python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Cache packages
uses: actions/cache@v2
with:
path: ${{ env.PYTHONUSERBASE }}
key: ${{ steps.python.outputs.python-version }}-full-${{ secrets.CACHE_KEY }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ steps.python.outputs.python-version }}-full-${{ secrets.CACHE_KEY }}-
cache: "poetry"
- name: Install dependencies
run: |
python -m pip install -U poetry pip wheel
poetry config virtualenvs.create false
poetry install -n
- name: Send coverage report
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
python -m pytest --cov-report term --cov awscliv2
python -m codecov
poetry run pytest --cov-report term --cov awscliv2
poetry run codecov
6 changes: 3 additions & 3 deletions .github/workflows/on_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Get version
id: version
uses: actions/github-script@v4
uses: actions/github-script@v6
with:
result-encoding: string
script: |
Expand Down

0 comments on commit fa33954

Please sign in to comment.