Skip to content

Commit

Permalink
CI: Use custom action, activate linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Privat33r-dev committed May 4, 2024
1 parent 2c28c8e commit 22119f8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 45 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Python ${{ env.PYTHON_VERSION }} and resolve Poetry dependencies
uses: Privat33r-dev/pymonster@master
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"

- name: Install poetry
run: pipx install poetry

- name: Setup poetry
run: |
poetry config virtualenvs.in-project true
poetry install --without dev

- name: Build package
run: |
Expand Down
60 changes: 26 additions & 34 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install and configure poetry
run: |
pipx install poetry
poetry config virtualenvs.in-project true
- name: Setup Python
uses: actions/setup-python@v5

- name: Setup Python ${{ env.PYTHON_VERSION }} and resolve Poetry dependencies
uses: Privat33r-dev/pymonster@master
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- name: Setup poetry
run: poetry install

- name: Run tests
run: |
source .venv/bin/activate
Expand All @@ -53,27 +48,28 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install and configure poetry
run: |
pipx install poetry
poetry config virtualenvs.in-project true
- name: Setup Python
uses: actions/setup-python@v5

- name: Setup Python ${{ env.PYTHON_VERSION }} and resolve Poetry dependencies
uses: Privat33r-dev/pymonster@master
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- name: Setup poetry
run: poetry install

- uses: pnpm/action-setup@v3
with:
version: 9

- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache: "pnpm"
cache-dependency-path: tests/apollo-server/

- name: Install deps and run server
run: |
cd tests/apollo-server/
npm ci
pnpm install
node src/index.js &
- name: Wait for server
run: |
for i in {0..10}; do
Expand All @@ -88,6 +84,7 @@ jobs:
exit 1
fi
done
- name: Test with pytest
run: |
source .venv/bin/activate
Expand All @@ -96,28 +93,23 @@ jobs:
lint:
runs-on: ubuntu-latest

if: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install and configure poetry
run: |
pipx install poetry
poetry config virtualenvs.in-project true
- name: Setup Python
uses: actions/setup-python@v5

- name: Setup Python ${{ env.PYTHON_VERSION }} and resolve Poetry dependencies
uses: Privat33r-dev/pymonster@master
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- name: Setup poetry
run: poetry install

- name: Run lint
if: always()
# A few checks are skipped for now because the code can't pass them
# TODO: reactivate them
run: |
source .venv/bin/activate
isort -m 9 --line-length 160 $MODULE_NAME tests --check-only
pylint $MODULE_NAME tests
isort -m 9 --line-length 160 $MODULE_NAME tests --gitignore --check-only
# pylint $MODULE_NAME tests
docformatter --wrap-summaries 160 --wrap-descriptions 160 -cr $MODULE_NAME tests
black --check $MODULE_NAME tests
mypy -V
mypy $MODULE_NAME tests
# mypy $MODULE_NAME tests

0 comments on commit 22119f8

Please sign in to comment.