From 3c3717b50091918b2f4b34351a75ba2f98ec1f15 Mon Sep 17 00:00:00 2001 From: Nikos Koukis Date: Sat, 10 Aug 2024 18:29:08 +0300 Subject: [PATCH] Refactor github workflows --- .github/workflows/ci.yml | 63 -------------------------- .github/workflows/install-software.yml | 50 ++++++++++++++++++++ .github/workflows/tests.yml | 29 ++++++++++++ 3 files changed, 79 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/install-software.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f14bf26..ee0f424 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,69 +3,6 @@ on: push: pull_request: jobs: - install_with_pip3: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.8" - - name: Install with pip3 - no extras - run: | - pip3 install . - pip3 show syncall - - name: Install with pip3 - all extras - run: | - pip3 install .[tw,google,notion,gkeep,asana,caldav] - pip3 show syncall - - name: Install with pip3 - tw - run: | - pip3 install .[tw] - pip3 show syncall - - name: Install with pip3 - google - run: | - pip3 install .[google] - pip3 show syncall - - name: Install with pip3 - notion - run: | - pip3 install .[notion] - pip3 show syncall - - name: Install with pip3 - gkeep - run: | - pip3 install .[gkeep] - pip3 show syncall - - name: Install with pip3 - asana - run: | - pip3 install .[asana] - pip3 show syncall - - name: Install with pip3 - caldav - run: | - pip3 install .[caldav] - pip3 show syncall - unittests: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - os: [ubuntu-latest] - python-version: ["3.8", "3.9"] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Python Poetry Action - uses: abatilo/actions-poetry@v2.1.3 - with: - poetry-version: "1.6.1" - - name: Install prerequisites - run: | - sudo ./scripts/install-taskwarrior.sh - poetry install --all-extras - poetry self add "poetry-dynamic-versioning[plugin]" - task --version - - name: Run tests - run: poetry run pytest style_and_linters: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/install-software.yml b/.github/workflows/install-software.yml new file mode 100644 index 0000000..489c4f1 --- /dev/null +++ b/.github/workflows/install-software.yml @@ -0,0 +1,50 @@ +name: CI +on: + push: + pull_request: +jobs: + install_main_only_with_pip3: + runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest] + python-version: ["3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install with pip3 - no extras + run: | + pip3 install . + pip3 show syncall + + install_extras_with_pip3: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest] + python-version: ["3.10", "3.11", "3.12"] + # use python-extra AND executable to tests its imports + # https://stackoverflow.com/questions/66025220/paired-values-in-github-actions-matrix + python-extra: + [ + "tw,google,notion,gkeep,asana,caldav", + "tw", + "google", + "notion", + "gkeep", + "asana", + "caldav", + ] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install with pip3 - with ${{ matrix.python-extra }} + run: | + pip install .[${{ matrix.python-extra }}] + pip3 show syncall diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d61fdab --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,29 @@ +name: Tests +on: + push: + pull_request: +jobs: + unittests: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Python Poetry Action + uses: abatilo/actions-poetry@v2.1.3 + with: + poetry-version: "1.6.1" + - name: Install prerequisites + run: | + sudo ./scripts/install-taskwarrior.sh + poetry install --all-extras + poetry self add "poetry-dynamic-versioning[plugin]" + task --version + - name: Run tests + run: poetry run pytest