From 872f5aac1b97fab9943eb19996f70a26022f63d8 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 3 Dec 2023 02:46:02 -0300 Subject: [PATCH 01/34] GIT: fix the draft PR check if PR is a draft --- .github/workflows/test_pytest.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 855cac949..e54c6949b 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -9,14 +9,19 @@ on: jobs: fail_if_pr_is_draft: - if: github.event.pull_request.draft == true - runs-on: ubuntu-18.04 + timeout-minutes: 2 + if: github.event.pull_request.draft + runs-on: ubuntu-latest steps: - - name: Fails in order to indicate that pull request needs to be marked as ready to review and unit tests workflow needs to pass. + - name: Check if PR is draft + run: echo "This pull request is a draft. Please mark it as ready for review before proceeding." + - name: Fail run: exit 1 pytest_and_doctest: + needs: fail_if_pr_is_draft runs-on: ${{ matrix.os }} strategy: + fail-fast: true matrix: os: - ubuntu-latest From 7202e598125d1dbe783741a2ee82fae23bc3364c Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 3 Dec 2023 02:52:05 -0300 Subject: [PATCH 02/34] GIT: Add pip cache to setup-python action --- .github/workflows/test_pytest.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index e54c6949b..a02e7422a 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -39,6 +39,7 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + cache: pip - name: Install dependencies run: | python -m pip install --upgrade pip From 0dc8da04f3daa50ddd2ac7f48b44319745600ca9 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 3 Dec 2023 02:55:27 -0300 Subject: [PATCH 03/34] GIT: Add pytest runslow flag for master branch --- .github/workflows/test_pytest.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index a02e7422a..e6ea890ae 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -57,6 +57,11 @@ jobs: pytest --cov=rocketpy --cov-report=xml cd rocketpy pytest --doctest-modules --cov=rocketpy --cov-report=xml + - name: Run pytest with runslow flag + if: github.ref == 'refs/heads/master' + run: | + cd .. + pytest --runslow --cov=rocketpy --cov-report=xml - name: Upload coverage report to Codecov uses: codecov/codecov-action@v3 with: From 12d6c7f29cb52ca4dc25627a0ceaf4aba19174e3 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 3 Dec 2023 02:57:33 -0300 Subject: [PATCH 04/34] GIT: Fix condition for checking if PR is draft --- .github/workflows/test_pytest.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index e6ea890ae..f08303c0d 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -10,7 +10,7 @@ on: jobs: fail_if_pr_is_draft: timeout-minutes: 2 - if: github.event.pull_request.draft + if: github.event.pull_request.draft == true runs-on: ubuntu-latest steps: - name: Check if PR is draft @@ -21,7 +21,6 @@ jobs: needs: fail_if_pr_is_draft runs-on: ${{ matrix.os }} strategy: - fail-fast: true matrix: os: - ubuntu-latest From 3d435e345e8056e7eb1b3a22b315f2ce6f41ff8f Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 3 Dec 2023 02:59:27 -0300 Subject: [PATCH 05/34] GIT: remove 'needs' attribute from pytest action --- .github/workflows/test_pytest.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index f08303c0d..afbf67d58 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -18,7 +18,6 @@ jobs: - name: Fail run: exit 1 pytest_and_doctest: - needs: fail_if_pr_is_draft runs-on: ${{ matrix.os }} strategy: matrix: @@ -67,7 +66,7 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} directory: ./coverage/reports/ env_vars: OS,PYTHON - fail_ci_if_error: true + fail_ci_if_error: false files: ./coverage.xml, ./rocketpy/coverage.xml flags: unittests name: codecov-umbrella From a8dde8711ae876d04f0d811d72097a350ca7cfd7 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 18:09:14 -0300 Subject: [PATCH 06/34] WIP: remove assign reviewers --- .github/auto-assign.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/auto-assign.yml b/.github/auto-assign.yml index 5b0b21e2f..f7a38c053 100644 --- a/.github/auto-assign.yml +++ b/.github/auto-assign.yml @@ -1,22 +1,2 @@ -# Set to true to add reviewers to PRs -addReviewers: true - # Set to 'author' to add PR's author as a assignee addAssignees: author - -# A list of reviewers to be added to PRs (GitHub user name) -reviewers: - - Gui-FernandesBR - - giovaniceotto - - MateusStano - - phmbressan - -# A number of reviewers added to the PR -# Set 0 to add all the reviewers (default: 0) -numberOfReviewers: 0 - -# A list of keywords to be skipped the process if PR's title include it -skipKeywords: - - wip - - work in progress - - draft From 2ef1cc51dcc3262a03bb3ad1d08676b6e546ef66 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 18:09:54 -0300 Subject: [PATCH 07/34] WIP: improve actions --- .github/workflows/lint_black.yaml | 4 ++-- .github/workflows/test_pytest.yaml | 19 +++++-------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/lint_black.yaml b/.github/workflows/lint_black.yaml index 59c2fc353..1e5c57676 100644 --- a/.github/workflows/lint_black.yaml +++ b/.github/workflows/lint_black.yaml @@ -16,10 +16,10 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: 3.8 + python-version: 3.10 - name: Install Python dependencies - run: pip install black + run: pip install black[jupyter] - name: Run linters uses: wearerequired/lint-action@v1 diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index afbf67d58..98252e72e 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -8,16 +8,7 @@ on: - ".github/**" jobs: - fail_if_pr_is_draft: - timeout-minutes: 2 - if: github.event.pull_request.draft == true - runs-on: ubuntu-latest - steps: - - name: Check if PR is draft - run: echo "This pull request is a draft. Please mark it as ready for review before proceeding." - - name: Fail - run: exit 1 - pytest_and_doctest: + Pytest: runs-on: ${{ matrix.os }} strategy: matrix: @@ -41,21 +32,21 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - - name: Build RocketPy (without optional dependencies) + - name: Build rocketpy run: | pip install . - - name: Import rocketpy in python and test if it works + - name: Test importing rocketpy run: | python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')" - name: Install optional dependencies run: | pip install -r requirements-tests.txt - - name: Test with pytest + - name: Run pytest run: | pytest --cov=rocketpy --cov-report=xml cd rocketpy pytest --doctest-modules --cov=rocketpy --cov-report=xml - - name: Run pytest with runslow flag + - name: Run pytest --runslow if: github.ref == 'refs/heads/master' run: | cd .. From b517a1d23b702d8703144f473d4b253185b3910a Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 18:11:17 -0300 Subject: [PATCH 08/34] WIP: bump black python requirement --- .github/workflows/lint_black.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint_black.yaml b/.github/workflows/lint_black.yaml index 1e5c57676..49a322991 100644 --- a/.github/workflows/lint_black.yaml +++ b/.github/workflows/lint_black.yaml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: 3.10 + python-version: 3.10.13 - name: Install Python dependencies run: pip install black[jupyter] From 8816c2ddf0d3c0c9b9223f75d8f964e8ceaa8be5 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 18:25:16 -0300 Subject: [PATCH 09/34] WIP: Update pytest command to include slow tests --- .github/workflows/test_pytest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 98252e72e..bb780d7bf 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -50,7 +50,7 @@ jobs: if: github.ref == 'refs/heads/master' run: | cd .. - pytest --runslow --cov=rocketpy --cov-report=xml + pytest -m slow --runslow --cov=rocketpy --cov-report=xml - name: Upload coverage report to Codecov uses: codecov/codecov-action@v3 with: From e0b6232e19c28806442f25c1e11c1b8b4579bbf4 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 18:44:01 -0300 Subject: [PATCH 10/34] WIP: separate into different jobs --- .github/workflows/test_pytest.yaml | 146 ++++++++++++++++++++++++++++- 1 file changed, 145 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index bb780d7bf..8c2977d7e 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -8,7 +8,7 @@ on: - ".github/**" jobs: - Pytest: + Build: runs-on: ${{ matrix.os }} strategy: matrix: @@ -38,14 +38,158 @@ jobs: - name: Test importing rocketpy run: | python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')" + + Unit: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + python-version: + - 3.8 + - 3.12 + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python-version }} + steps: + - name: Install optional dependencies + run: | + pip install -r requirements-tests.txt + - name: Run pytest + run: | + pytest -k "unit" --cov=rocketpy --cov-report=xml + - name: Upload coverage report to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./coverage/reports/ + env_vars: OS,PYTHON + fail_ci_if_error: false + files: ./coverage.xml, ./rocketpy/coverage.xml + flags: unittests + name: codecov-umbrella + verbose: true + + Acceptance: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + python-version: + - 3.8 + - 3.12 + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python-version }} + steps: - name: Install optional dependencies run: | pip install -r requirements-tests.txt - name: Run pytest run: | pytest --cov=rocketpy --cov-report=xml + - name: Upload coverage report to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./coverage/reports/ + env_vars: OS,PYTHON + fail_ci_if_error: false + files: ./coverage.xml, ./rocketpy/coverage.xml + flags: unittests + name: codecov-umbrella + verbose: true + + Integration: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + python-version: + - 3.8 + - 3.12 + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python-version }} + steps: + - name: Install optional dependencies + run: | + pip install -r requirements-tests.txt + - name: Run pytest + run: | + pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml + - name: Upload coverage report to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./coverage/reports/ + env_vars: OS,PYTHON + fail_ci_if_error: false + files: ./coverage.xml, ./rocketpy/coverage.xml + flags: unittests + name: codecov-umbrella + verbose: true + + Doc: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + python-version: + - 3.8 + - 3.12 + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python-version }} + steps: + - name: Install optional dependencies + run: | + pip install -r requirements-tests.txt + - name: Run pytest + run: | cd rocketpy pytest --doctest-modules --cov=rocketpy --cov-report=xml + - name: Upload coverage report to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./coverage/reports/ + env_vars: OS,PYTHON + fail_ci_if_error: false + files: ./coverage.xml, ./rocketpy/coverage.xml + flags: unittests + name: codecov-umbrella + verbose: true + + Slow: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + python-version: + - 3.8 + - 3.12 + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python-version }} + steps: + - name: Install optional dependencies + run: | + pip install -r requirements-tests.txt - name: Run pytest --runslow if: github.ref == 'refs/heads/master' run: | From a81e7c97b2cc2104074558c948cafc99ab49b599 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 18:59:35 -0300 Subject: [PATCH 11/34] WIP: separate different jobs --- .github/workflows/test_pytest.yaml | 202 ++++++++++------------------- 1 file changed, 65 insertions(+), 137 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 8c2977d7e..c58e7ce0b 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -7,202 +7,130 @@ on: - "**.py" - ".github/**" +defaults: + run: + shell: bash + +setup-python: &setup-python + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + cache: pip + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install . + +setup-tests: &setup-tests + - *setup-python + - name: Install optional dependencies + run: pip install -r requirements-tests.txt + +upload-codecov: &upload-codecov + - name: Upload coverage report to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./coverage/reports/ + env_vars: OS,PYTHON + fail_ci_if_error: false + files: ./coverage.xml, ./rocketpy/coverage.xml + flags: unittests + name: codecov-umbrella + verbose: true + jobs: Build: runs-on: ${{ matrix.os }} strategy: matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - python-version: - - 3.8 - - 3.12 + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.8, 3.12] env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - cache: pip - - name: Install dependencies - run: | - python -m pip install --upgrade pip - - name: Build rocketpy - run: | - pip install . + - *setup-python - name: Test importing rocketpy - run: | - python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')" + run: python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')" Unit: runs-on: ${{ matrix.os }} strategy: matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - python-version: - - 3.8 - - 3.12 + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.8, 3.12] env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - name: Install optional dependencies - run: | - pip install -r requirements-tests.txt - - name: Run pytest - run: | - pytest -k "unit" --cov=rocketpy --cov-report=xml - - name: Upload coverage report to Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: ./coverage/reports/ - env_vars: OS,PYTHON - fail_ci_if_error: false - files: ./coverage.xml, ./rocketpy/coverage.xml - flags: unittests - name: codecov-umbrella - verbose: true + - *setup-tests + - name: Run pytest (Unit Tests) + run: pytest -k "unit" --cov=rocketpy --cov-report=xml + - *upload-codecov Acceptance: runs-on: ${{ matrix.os }} strategy: matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - python-version: - - 3.8 - - 3.12 + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.8, 3.12] env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - name: Install optional dependencies - run: | - pip install -r requirements-tests.txt - - name: Run pytest - run: | - pytest --cov=rocketpy --cov-report=xml - - name: Upload coverage report to Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: ./coverage/reports/ - env_vars: OS,PYTHON - fail_ci_if_error: false - files: ./coverage.xml, ./rocketpy/coverage.xml - flags: unittests - name: codecov-umbrella - verbose: true + - *setup-tests + - name: Run pytest (Acceptance Tests) + run: pytest --cov=rocketpy --cov-report=xml + - *upload-codecov Integration: runs-on: ${{ matrix.os }} strategy: matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - python-version: - - 3.8 - - 3.12 + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.8, 3.12] env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - name: Install optional dependencies - run: | - pip install -r requirements-tests.txt - - name: Run pytest - run: | - pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml - - name: Upload coverage report to Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: ./coverage/reports/ - env_vars: OS,PYTHON - fail_ci_if_error: false - files: ./coverage.xml, ./rocketpy/coverage.xml - flags: unittests - name: codecov-umbrella - verbose: true + - *setup-tests + - name: Run pytest (Integration Tests) + run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml + - *upload-codecov Doc: runs-on: ${{ matrix.os }} strategy: matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - python-version: - - 3.8 - - 3.12 + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.8, 3.12] env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - name: Install optional dependencies - run: | - pip install -r requirements-tests.txt - - name: Run pytest + - *setup-tests + - name: Run pytest (Documentation Tests) run: | cd rocketpy pytest --doctest-modules --cov=rocketpy --cov-report=xml - - name: Upload coverage report to Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: ./coverage/reports/ - env_vars: OS,PYTHON - fail_ci_if_error: false - files: ./coverage.xml, ./rocketpy/coverage.xml - flags: unittests - name: codecov-umbrella - verbose: true + - *upload-codecov Slow: runs-on: ${{ matrix.os }} strategy: matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - python-version: - - 3.8 - - 3.12 + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.8, 3.12] env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - name: Install optional dependencies - run: | - pip install -r requirements-tests.txt + - *setup-tests - name: Run pytest --runslow if: github.ref == 'refs/heads/master' run: | - cd .. pytest -m slow --runslow --cov=rocketpy --cov-report=xml - - name: Upload coverage report to Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: ./coverage/reports/ - env_vars: OS,PYTHON - fail_ci_if_error: false - files: ./coverage.xml, ./rocketpy/coverage.xml - flags: unittests - name: codecov-umbrella - verbose: true + - *upload-codecov From 8c502693580c66026fbd5076e378441ce9dbf8ea Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 19:12:34 -0300 Subject: [PATCH 12/34] WIP: avoid alias --- .github/workflows/setup-python.sh | 3 + .github/workflows/test_pytest.yaml | 94 ++++++++++++++----------- .github/workflows/upload_to_codecov.yml | 30 ++++++++ 3 files changed, 86 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/setup-python.sh create mode 100644 .github/workflows/upload_to_codecov.yml diff --git a/.github/workflows/setup-python.sh b/.github/workflows/setup-python.sh new file mode 100644 index 000000000..949519506 --- /dev/null +++ b/.github/workflows/setup-python.sh @@ -0,0 +1,3 @@ +#!/bin/bash +python -m pip install --upgrade pip +pip install . diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index c58e7ce0b..14a114c92 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -11,36 +11,6 @@ defaults: run: shell: bash -setup-python: &setup-python - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - cache: pip - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install . - -setup-tests: &setup-tests - - *setup-python - - name: Install optional dependencies - run: pip install -r requirements-tests.txt - -upload-codecov: &upload-codecov - - name: Upload coverage report to Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: ./coverage/reports/ - env_vars: OS,PYTHON - fail_ci_if_error: false - files: ./coverage.xml, ./rocketpy/coverage.xml - flags: unittests - name: codecov-umbrella - verbose: true - jobs: Build: runs-on: ${{ matrix.os }} @@ -52,11 +22,19 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - *setup-python + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + cache: pip + - name: Install dependencies + run: bash setup-python.sh - name: Test importing rocketpy run: python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')" Unit: + needs: Build runs-on: ${{ matrix.os }} strategy: matrix: @@ -66,12 +44,19 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - *setup-tests + - name: Install dependencies + run: bash setup-python.sh - name: Run pytest (Unit Tests) run: pytest -k "unit" --cov=rocketpy --cov-report=xml - - *upload-codecov + - name: Call reusable workflow for Codecov upload + uses: ./.github/workflows/upload-to-codecov.yml + with: + codecov_token: ${{ secrets.CODECOV_TOKEN }} + os: ${{ matrix.os }} + python: ${{ matrix.python-version }} Acceptance: + needs: [Build, Unit] runs-on: ${{ matrix.os }} strategy: matrix: @@ -81,12 +66,19 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - *setup-tests + - name: Install dependencies + run: bash setup-python.sh - name: Run pytest (Acceptance Tests) run: pytest --cov=rocketpy --cov-report=xml - - *upload-codecov + - name: Call reusable workflow for Codecov upload + uses: ./.github/workflows/upload-to-codecov.yml + with: + codecov_token: ${{ secrets.CODECOV_TOKEN }} + os: ${{ matrix.os }} + python: ${{ matrix.python-version }} Integration: + needs: [Build, Unit] runs-on: ${{ matrix.os }} strategy: matrix: @@ -96,12 +88,19 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - *setup-tests + - name: Install dependencies + run: bash setup-python.sh - name: Run pytest (Integration Tests) run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml - - *upload-codecov + - name: Call reusable workflow for Codecov upload + uses: ./.github/workflows/upload-to-codecov.yml + with: + codecov_token: ${{ secrets.CODECOV_TOKEN }} + os: ${{ matrix.os }} + python: ${{ matrix.python-version }} Doc: + needs: [Build, Unit] runs-on: ${{ matrix.os }} strategy: matrix: @@ -111,14 +110,21 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - *setup-tests + - name: Install dependencies + run: bash setup-python.sh - name: Run pytest (Documentation Tests) run: | cd rocketpy pytest --doctest-modules --cov=rocketpy --cov-report=xml - - *upload-codecov + - name: Call reusable workflow for Codecov upload + uses: ./.github/workflows/upload-to-codecov.yml + with: + codecov_token: ${{ secrets.CODECOV_TOKEN }} + os: ${{ matrix.os }} + python: ${{ matrix.python-version }} Slow: + needs: [Build, Unit, Acceptance, Integration, Doc] runs-on: ${{ matrix.os }} strategy: matrix: @@ -128,9 +134,15 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - *setup-tests + - name: Install dependencies + run: bash setup-python.sh - name: Run pytest --runslow if: github.ref == 'refs/heads/master' run: | pytest -m slow --runslow --cov=rocketpy --cov-report=xml - - *upload-codecov + - name: Call reusable workflow for Codecov upload + uses: ./.github/workflows/upload-to-codecov.yml + with: + codecov_token: ${{ secrets.CODECOV_TOKEN }} + os: ${{ matrix.os }} + python: ${{ matrix.python-version }} diff --git a/.github/workflows/upload_to_codecov.yml b/.github/workflows/upload_to_codecov.yml new file mode 100644 index 000000000..7e29bd7fe --- /dev/null +++ b/.github/workflows/upload_to_codecov.yml @@ -0,0 +1,30 @@ +name: Upload to Codecov + +on: + workflow_call: + inputs: + codecov_token: + required: true + type: secret + os: + required: true + type: string + python: + required: true + type: string + +jobs: + upload: + runs-on: ubuntu-latest + steps: + - name: Upload coverage report to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ inputs.codecov_token }} + directory: ./coverage/reports/ + env_vars: ${{ inputs.os }}, ${{ inputs.python }} + fail_ci_if_error: false + files: ./coverage.xml, ./rocketpy/coverage.xml + flags: unittests + name: codecov-umbrella + verbose: true From a1ed43104f768ea47438a321e7783703431fe64e Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 19:13:35 -0300 Subject: [PATCH 13/34] WIP: update dependencies --- .github/workflows/test_pytest.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 14a114c92..f54aeb8cf 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -56,7 +56,7 @@ jobs: python: ${{ matrix.python-version }} Acceptance: - needs: [Build, Unit] + needs: Unit runs-on: ${{ matrix.os }} strategy: matrix: @@ -78,7 +78,7 @@ jobs: python: ${{ matrix.python-version }} Integration: - needs: [Build, Unit] + needs: Unit runs-on: ${{ matrix.os }} strategy: matrix: @@ -100,7 +100,7 @@ jobs: python: ${{ matrix.python-version }} Doc: - needs: [Build, Unit] + needs: Unit runs-on: ${{ matrix.os }} strategy: matrix: @@ -124,7 +124,7 @@ jobs: python: ${{ matrix.python-version }} Slow: - needs: [Build, Unit, Acceptance, Integration, Doc] + needs: [Acceptance, Integration, Doc] runs-on: ${{ matrix.os }} strategy: matrix: From f78d51864c3b2461247652c764c7ce82b7014282 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 19:16:54 -0300 Subject: [PATCH 14/34] WIP: improve the pip install step --- .github/workflows/setup-python.sh | 3 +-- .github/workflows/test_pytest.yaml | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/setup-python.sh b/.github/workflows/setup-python.sh index 949519506..c575d56e6 100644 --- a/.github/workflows/setup-python.sh +++ b/.github/workflows/setup-python.sh @@ -1,3 +1,2 @@ #!/bin/bash -python -m pip install --upgrade pip -pip install . +pip install -r requirements_tests.txt diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index f54aeb8cf..4e22e2b11 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -28,8 +28,8 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: pip - - name: Install dependencies - run: bash setup-python.sh + - name: Install rocketpy + run: pip install . - name: Test importing rocketpy run: python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')" From d79863dcff597f3d0793a60f0045d7ee3313dba4 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 19:19:43 -0300 Subject: [PATCH 15/34] WIP: no longer runs bash external file --- .github/workflows/setup-python.sh | 2 -- .github/workflows/test_pytest.yaml | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) delete mode 100644 .github/workflows/setup-python.sh diff --git a/.github/workflows/setup-python.sh b/.github/workflows/setup-python.sh deleted file mode 100644 index c575d56e6..000000000 --- a/.github/workflows/setup-python.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -pip install -r requirements_tests.txt diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 4e22e2b11..c759fc7f4 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -45,7 +45,7 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: bash setup-python.sh + run: pip install -r requirements_tests.txt - name: Run pytest (Unit Tests) run: pytest -k "unit" --cov=rocketpy --cov-report=xml - name: Call reusable workflow for Codecov upload @@ -67,7 +67,7 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: bash setup-python.sh + run: pip_tests install - name: Run pytest (Acceptance Tests) run: pytest --cov=rocketpy --cov-report=xml - name: Call reusable workflow for Codecov upload @@ -89,7 +89,7 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: bash setup-python.sh + run: pip_tests install - name: Run pytest (Integration Tests) run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml - name: Call reusable workflow for Codecov upload @@ -111,7 +111,7 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: bash setup-python.sh + run: pip_tests install - name: Run pytest (Documentation Tests) run: | cd rocketpy @@ -135,7 +135,7 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: bash setup-python.sh + run: pip_tests install - name: Run pytest --runslow if: github.ref == 'refs/heads/master' run: | From 68e957c38d384cd92d05242b442247257bbd9e28 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 19:23:19 -0300 Subject: [PATCH 16/34] WIP: join build and unit tests --- .github/workflows/test_pytest.yaml | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index c759fc7f4..02bd97a1f 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -12,7 +12,7 @@ defaults: shell: bash jobs: - Build: + Build_and_Unit: runs-on: ${{ matrix.os }} strategy: matrix: @@ -32,19 +32,7 @@ jobs: run: pip install . - name: Test importing rocketpy run: python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')" - - Unit: - needs: Build - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.8, 3.12] - env: - OS: ${{ matrix.os }} - PYTHON: ${{ matrix.python-version }} - steps: - - name: Install dependencies + - name: Install dev dependencies run: pip install -r requirements_tests.txt - name: Run pytest (Unit Tests) run: pytest -k "unit" --cov=rocketpy --cov-report=xml @@ -56,7 +44,7 @@ jobs: python: ${{ matrix.python-version }} Acceptance: - needs: Unit + needs: Build_and_Unit runs-on: ${{ matrix.os }} strategy: matrix: @@ -67,7 +55,7 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: pip_tests install + run: pip install -r requirements_tests.txt - name: Run pytest (Acceptance Tests) run: pytest --cov=rocketpy --cov-report=xml - name: Call reusable workflow for Codecov upload @@ -78,7 +66,7 @@ jobs: python: ${{ matrix.python-version }} Integration: - needs: Unit + needs: Build_and_Unit runs-on: ${{ matrix.os }} strategy: matrix: @@ -89,7 +77,7 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: pip_tests install + run: pip install -r requirements_tests.txt - name: Run pytest (Integration Tests) run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml - name: Call reusable workflow for Codecov upload @@ -100,7 +88,7 @@ jobs: python: ${{ matrix.python-version }} Doc: - needs: Unit + needs: Build_and_Unit runs-on: ${{ matrix.os }} strategy: matrix: @@ -111,7 +99,7 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: pip_tests install + run: pip install -r requirements_tests.txt - name: Run pytest (Documentation Tests) run: | cd rocketpy @@ -135,7 +123,7 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: pip_tests install + run: pip install -r requirements_tests.txt - name: Run pytest --runslow if: github.ref == 'refs/heads/master' run: | From 3f74377eb9092967a5652c1bb920e4beaeb2bd5f Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 19:25:07 -0300 Subject: [PATCH 17/34] WIP: Fix typo in requirements file names --- .github/workflows/test_pytest.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 02bd97a1f..dc30f841b 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -33,7 +33,7 @@ jobs: - name: Test importing rocketpy run: python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')" - name: Install dev dependencies - run: pip install -r requirements_tests.txt + run: pip install -r requirements-tests.txt - name: Run pytest (Unit Tests) run: pytest -k "unit" --cov=rocketpy --cov-report=xml - name: Call reusable workflow for Codecov upload @@ -55,7 +55,7 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: pip install -r requirements_tests.txt + run: pip install -r requirements-tests.txt - name: Run pytest (Acceptance Tests) run: pytest --cov=rocketpy --cov-report=xml - name: Call reusable workflow for Codecov upload @@ -77,7 +77,7 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: pip install -r requirements_tests.txt + run: pip install -r requirements-tests.txt - name: Run pytest (Integration Tests) run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml - name: Call reusable workflow for Codecov upload @@ -99,7 +99,7 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: pip install -r requirements_tests.txt + run: pip install -r requirements-tests.txt - name: Run pytest (Documentation Tests) run: | cd rocketpy @@ -123,7 +123,7 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: pip install -r requirements_tests.txt + run: pip install -r requirements-tests.txt - name: Run pytest --runslow if: github.ref == 'refs/heads/master' run: | From d2d104e2be4b21ac6c6c8dba49973bb07d1f20b2 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 19:31:18 -0300 Subject: [PATCH 18/34] WIP: rename Codecov workflow for uploading coverage reports --- .github/workflows/test_pytest.yaml | 12 ++++++------ .../{upload_to_codecov.yml => upload-to-codecov.yml} | 0 2 files changed, 6 insertions(+), 6 deletions(-) rename .github/workflows/{upload_to_codecov.yml => upload-to-codecov.yml} (100%) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index dc30f841b..b58f8a922 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -32,11 +32,11 @@ jobs: run: pip install . - name: Test importing rocketpy run: python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')" - - name: Install dev dependencies + - name: Install test dependencies run: pip install -r requirements-tests.txt - name: Run pytest (Unit Tests) run: pytest -k "unit" --cov=rocketpy --cov-report=xml - - name: Call reusable workflow for Codecov upload + - name: Codecov upload uses: ./.github/workflows/upload-to-codecov.yml with: codecov_token: ${{ secrets.CODECOV_TOKEN }} @@ -58,7 +58,7 @@ jobs: run: pip install -r requirements-tests.txt - name: Run pytest (Acceptance Tests) run: pytest --cov=rocketpy --cov-report=xml - - name: Call reusable workflow for Codecov upload + - name: Codecov upload uses: ./.github/workflows/upload-to-codecov.yml with: codecov_token: ${{ secrets.CODECOV_TOKEN }} @@ -80,7 +80,7 @@ jobs: run: pip install -r requirements-tests.txt - name: Run pytest (Integration Tests) run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml - - name: Call reusable workflow for Codecov upload + - name: Codecov upload uses: ./.github/workflows/upload-to-codecov.yml with: codecov_token: ${{ secrets.CODECOV_TOKEN }} @@ -104,7 +104,7 @@ jobs: run: | cd rocketpy pytest --doctest-modules --cov=rocketpy --cov-report=xml - - name: Call reusable workflow for Codecov upload + - name: Codecov upload uses: ./.github/workflows/upload-to-codecov.yml with: codecov_token: ${{ secrets.CODECOV_TOKEN }} @@ -128,7 +128,7 @@ jobs: if: github.ref == 'refs/heads/master' run: | pytest -m slow --runslow --cov=rocketpy --cov-report=xml - - name: Call reusable workflow for Codecov upload + - name: Codecov upload uses: ./.github/workflows/upload-to-codecov.yml with: codecov_token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/upload_to_codecov.yml b/.github/workflows/upload-to-codecov.yml similarity index 100% rename from .github/workflows/upload_to_codecov.yml rename to .github/workflows/upload-to-codecov.yml From 0538228f1fa2103fd0c3122fe1ad4d6f9a629c8f Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 19:42:06 -0300 Subject: [PATCH 19/34] WIP: try new codecov strategy --- .github/workflows/test_pytest.yaml | 61 ++++++++++++++----------- .github/workflows/upload-to-codecov.yml | 3 +- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index b58f8a922..6ba07feee 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -36,12 +36,11 @@ jobs: run: pip install -r requirements-tests.txt - name: Run pytest (Unit Tests) run: pytest -k "unit" --cov=rocketpy --cov-report=xml - - name: Codecov upload - uses: ./.github/workflows/upload-to-codecov.yml + - name: Upload coverage to artifacts + uses: actions/upload-artifact@v2 with: - codecov_token: ${{ secrets.CODECOV_TOKEN }} - os: ${{ matrix.os }} - python: ${{ matrix.python-version }} + name: coverage-build-and-unit + path: path/to/your/coverage/report Acceptance: needs: Build_and_Unit @@ -58,12 +57,11 @@ jobs: run: pip install -r requirements-tests.txt - name: Run pytest (Acceptance Tests) run: pytest --cov=rocketpy --cov-report=xml - - name: Codecov upload - uses: ./.github/workflows/upload-to-codecov.yml + - name: Upload coverage to artifacts + uses: actions/upload-artifact@v2 with: - codecov_token: ${{ secrets.CODECOV_TOKEN }} - os: ${{ matrix.os }} - python: ${{ matrix.python-version }} + name: coverage-build-and-unit + path: path/to/your/coverage/report Integration: needs: Build_and_Unit @@ -80,13 +78,11 @@ jobs: run: pip install -r requirements-tests.txt - name: Run pytest (Integration Tests) run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml - - name: Codecov upload - uses: ./.github/workflows/upload-to-codecov.yml + - name: Upload coverage to artifacts + uses: actions/upload-artifact@v2 with: - codecov_token: ${{ secrets.CODECOV_TOKEN }} - os: ${{ matrix.os }} - python: ${{ matrix.python-version }} - + name: coverage-build-and-unit + path: path/to/your/coverage/report Doc: needs: Build_and_Unit runs-on: ${{ matrix.os }} @@ -104,13 +100,11 @@ jobs: run: | cd rocketpy pytest --doctest-modules --cov=rocketpy --cov-report=xml - - name: Codecov upload - uses: ./.github/workflows/upload-to-codecov.yml + - name: Upload coverage to artifacts + uses: actions/upload-artifact@v2 with: - codecov_token: ${{ secrets.CODECOV_TOKEN }} - os: ${{ matrix.os }} - python: ${{ matrix.python-version }} - + name: coverage-build-and-unit + path: path/to/your/coverage/report Slow: needs: [Acceptance, Integration, Doc] runs-on: ${{ matrix.os }} @@ -128,9 +122,22 @@ jobs: if: github.ref == 'refs/heads/master' run: | pytest -m slow --runslow --cov=rocketpy --cov-report=xml - - name: Codecov upload - uses: ./.github/workflows/upload-to-codecov.yml + - name: Upload coverage to artifacts + uses: actions/upload-artifact@v2 + with: + name: coverage-build-and-unit + path: path/to/your/coverage/report + + CodecovUpload: + if: always() + needs: [Build_and_Unit, Acceptance, Integration, Doc, Slow] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Download all coverage reports + uses: actions/download-artifact@v2 + - name: Upload to Codecov + uses: codecov/codecov-action@v2 with: - codecov_token: ${{ secrets.CODECOV_TOKEN }} - os: ${{ matrix.os }} - python: ${{ matrix.python-version }} + token: ${{ secrets.CODECOV_TOKEN }} + files: ./path/to/downloaded/coverage/reports/* diff --git a/.github/workflows/upload-to-codecov.yml b/.github/workflows/upload-to-codecov.yml index 7e29bd7fe..806169865 100644 --- a/.github/workflows/upload-to-codecov.yml +++ b/.github/workflows/upload-to-codecov.yml @@ -22,8 +22,7 @@ jobs: with: token: ${{ inputs.codecov_token }} directory: ./coverage/reports/ - env_vars: ${{ inputs.os }}, ${{ inputs.python }} - fail_ci_if_error: false + env_vars: OS,PYTHON files: ./coverage.xml, ./rocketpy/coverage.xml flags: unittests name: codecov-umbrella From 53811930abd03d1f5fa3d127a9ed8368a93c4baa Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 19:54:08 -0300 Subject: [PATCH 20/34] WIP: rename targets coverage.xml --- .github/workflows/test_pytest.yaml | 35 +++++++++++++++++++----------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 6ba07feee..abfc32519 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -35,12 +35,12 @@ jobs: - name: Install test dependencies run: pip install -r requirements-tests.txt - name: Run pytest (Unit Tests) - run: pytest -k "unit" --cov=rocketpy --cov-report=xml + run: pytest -k "unit" --cov=rocketpy --cov-report=xml:./coverage_unit.xml - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: name: coverage-build-and-unit - path: path/to/your/coverage/report + path: coverage_unit.xml Acceptance: needs: Build_and_Unit @@ -53,15 +53,19 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - name: Install dependencies - run: pip install -r requirements-tests.txt + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + cache: pip - name: Run pytest (Acceptance Tests) - run: pytest --cov=rocketpy --cov-report=xml + run: pytest --cov=rocketpy --cov-report=xml:./coverage_accept.xml - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: name: coverage-build-and-unit - path: path/to/your/coverage/report + path: coverage_accept.xml Integration: needs: Build_and_Unit @@ -77,12 +81,12 @@ jobs: - name: Install dependencies run: pip install -r requirements-tests.txt - name: Run pytest (Integration Tests) - run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml + run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml:./coverage_integr.xml - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: name: coverage-build-and-unit - path: path/to/your/coverage/report + path: coverage_integr.xml Doc: needs: Build_and_Unit runs-on: ${{ matrix.os }} @@ -99,12 +103,12 @@ jobs: - name: Run pytest (Documentation Tests) run: | cd rocketpy - pytest --doctest-modules --cov=rocketpy --cov-report=xml + pytest --doctest-modules --cov=rocketpy --cov-report=xml:./coverage_docs.xml - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: name: coverage-build-and-unit - path: path/to/your/coverage/report + path: coverage_docs.xml Slow: needs: [Acceptance, Integration, Doc] runs-on: ${{ matrix.os }} @@ -121,12 +125,12 @@ jobs: - name: Run pytest --runslow if: github.ref == 'refs/heads/master' run: | - pytest -m slow --runslow --cov=rocketpy --cov-report=xml + pytest -m slow --runslow --cov=rocketpy --cov-report=xml:./coverage_slow.xml - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: name: coverage-build-and-unit - path: path/to/your/coverage/report + path: coverage_slow.xml CodecovUpload: if: always() @@ -140,4 +144,9 @@ jobs: uses: codecov/codecov-action@v2 with: token: ${{ secrets.CODECOV_TOKEN }} - files: ./path/to/downloaded/coverage/reports/* + files: | + coverage_unit.xml + coverage_accept.xml + coverage_integr.xml + coverage_docs.xml + coverage_slow.xml From 8669b750810025a17378a7e3471e979411751c1d Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 19:56:16 -0300 Subject: [PATCH 21/34] WIP: rename coverage files --- .github/workflows/test_pytest.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index abfc32519..86f451483 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -64,7 +64,7 @@ jobs: - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: - name: coverage-build-and-unit + name: coverage-acceptance path: coverage_accept.xml Integration: @@ -85,7 +85,7 @@ jobs: - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: - name: coverage-build-and-unit + name: coverage-integration path: coverage_integr.xml Doc: needs: Build_and_Unit @@ -107,7 +107,7 @@ jobs: - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: - name: coverage-build-and-unit + name: coverage-docs path: coverage_docs.xml Slow: needs: [Acceptance, Integration, Doc] @@ -129,11 +129,10 @@ jobs: - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: - name: coverage-build-and-unit + name: coverage-slow path: coverage_slow.xml CodecovUpload: - if: always() needs: [Build_and_Unit, Acceptance, Integration, Doc, Slow] runs-on: ubuntu-latest steps: From ac3bd251ebf4ff8eb5714016ab2f66a03ddae053 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 20:03:47 -0300 Subject: [PATCH 22/34] WIP: better codecov workflow --- .github/workflows/upload-to-codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-to-codecov.yml b/.github/workflows/upload-to-codecov.yml index 806169865..431131c2a 100644 --- a/.github/workflows/upload-to-codecov.yml +++ b/.github/workflows/upload-to-codecov.yml @@ -5,7 +5,7 @@ on: inputs: codecov_token: required: true - type: secret + type: string os: required: true type: string From 9dfa74876d9b3f0409444da703754b9c2ae687ee Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 20:04:02 -0300 Subject: [PATCH 23/34] WIP: pip install tests requirements --- .github/workflows/test_pytest.yaml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 86f451483..8a536d5b7 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -59,6 +59,10 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: pip + - name: Install dependencies + run: | + pip install . + pip install -r requirements-tests.txt - name: Run pytest (Acceptance Tests) run: pytest --cov=rocketpy --cov-report=xml:./coverage_accept.xml - name: Upload coverage to artifacts @@ -79,7 +83,9 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: pip install -r requirements-tests.txt + run: | + pip install . + pip install -r requirements-tests.txt - name: Run pytest (Integration Tests) run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml:./coverage_integr.xml - name: Upload coverage to artifacts @@ -99,7 +105,9 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: pip install -r requirements-tests.txt + run: | + pip install . + pip install -r requirements-tests.txt - name: Run pytest (Documentation Tests) run: | cd rocketpy @@ -121,7 +129,10 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - name: Install dependencies - run: pip install -r requirements-tests.txt + run: | + pip install . + pip install -r requirements-tests.txt + pip install -r requirements-optional.txt - name: Run pytest --runslow if: github.ref == 'refs/heads/master' run: | From 6db551defd2ae7776ba7a93edd38af1d82c33f14 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 20:05:44 -0300 Subject: [PATCH 24/34] WIP: change the "needs" fields again --- .github/workflows/test_pytest.yaml | 39 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 8a536d5b7..b2f75b741 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -42,7 +42,7 @@ jobs: name: coverage-build-and-unit path: coverage_unit.xml - Acceptance: + Integration: needs: Build_and_Unit runs-on: ${{ matrix.os }} strategy: @@ -53,26 +53,20 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - cache: pip - name: Install dependencies run: | pip install . pip install -r requirements-tests.txt - - name: Run pytest (Acceptance Tests) - run: pytest --cov=rocketpy --cov-report=xml:./coverage_accept.xml + - name: Run pytest (Integration Tests) + run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml:./coverage_integr.xml - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: - name: coverage-acceptance - path: coverage_accept.xml + name: coverage-integration + path: coverage_integr.xml - Integration: - needs: Build_and_Unit + Acceptance: + needs: Integration runs-on: ${{ matrix.os }} strategy: matrix: @@ -82,19 +76,26 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + cache: pip - name: Install dependencies run: | pip install . pip install -r requirements-tests.txt - - name: Run pytest (Integration Tests) - run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml:./coverage_integr.xml + - name: Run pytest (Acceptance Tests) + run: pytest --cov=rocketpy --cov-report=xml:./coverage_accept.xml - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: - name: coverage-integration - path: coverage_integr.xml + name: coverage-acceptance + path: coverage_accept.xml + Doc: - needs: Build_and_Unit + needs: Integration runs-on: ${{ matrix.os }} strategy: matrix: @@ -118,7 +119,7 @@ jobs: name: coverage-docs path: coverage_docs.xml Slow: - needs: [Acceptance, Integration, Doc] + needs: [Acceptance, Doc] runs-on: ${{ matrix.os }} strategy: matrix: From 549abd3685d6edb911c4f3fbcb95ccf15aee72ea Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 20:12:42 -0300 Subject: [PATCH 25/34] WIP: setting up python correctly --- .github/workflows/test_pytest.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index b2f75b741..5c814bf91 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -53,6 +53,12 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + cache: pip - name: Install dependencies run: | pip install . @@ -105,6 +111,12 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + cache: pip - name: Install dependencies run: | pip install . @@ -129,6 +141,12 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + cache: pip - name: Install dependencies run: | pip install . From 216844d26359d5cb1791e9b0345111fdee1a8944 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 20:21:22 -0300 Subject: [PATCH 26/34] WIP: only normal and slow jobs now --- .github/workflows/test_pytest.yaml | 80 +++--------------------------- 1 file changed, 7 insertions(+), 73 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 5c814bf91..e27dac708 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -12,7 +12,7 @@ defaults: shell: bash jobs: - Build_and_Unit: + Normal: runs-on: ${{ matrix.os }} strategy: matrix: @@ -34,94 +34,28 @@ jobs: run: python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')" - name: Install test dependencies run: pip install -r requirements-tests.txt - - name: Run pytest (Unit Tests) + - name: Run Unit Tests run: pytest -k "unit" --cov=rocketpy --cov-report=xml:./coverage_unit.xml - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: name: coverage-build-and-unit path: coverage_unit.xml - - Integration: - needs: Build_and_Unit - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.8, 3.12] - env: - OS: ${{ matrix.os }} - PYTHON: ${{ matrix.python-version }} - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - cache: pip - - name: Install dependencies - run: | - pip install . - pip install -r requirements-tests.txt - - name: Run pytest (Integration Tests) + - name: Run Integration Tests run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml:./coverage_integr.xml - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: name: coverage-integration path: coverage_integr.xml - - Acceptance: - needs: Integration - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.8, 3.12] - env: - OS: ${{ matrix.os }} - PYTHON: ${{ matrix.python-version }} - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - cache: pip - - name: Install dependencies - run: | - pip install . - pip install -r requirements-tests.txt - - name: Run pytest (Acceptance Tests) + - name: Run Acceptance Tests run: pytest --cov=rocketpy --cov-report=xml:./coverage_accept.xml - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: name: coverage-acceptance path: coverage_accept.xml - - Doc: - needs: Integration - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.8, 3.12] - env: - OS: ${{ matrix.os }} - PYTHON: ${{ matrix.python-version }} - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - cache: pip - - name: Install dependencies - run: | - pip install . - pip install -r requirements-tests.txt - - name: Run pytest (Documentation Tests) + - name: Run Documentation Tests run: | cd rocketpy pytest --doctest-modules --cov=rocketpy --cov-report=xml:./coverage_docs.xml @@ -131,7 +65,7 @@ jobs: name: coverage-docs path: coverage_docs.xml Slow: - needs: [Acceptance, Doc] + needs: Normal runs-on: ${{ matrix.os }} strategy: matrix: @@ -163,7 +97,7 @@ jobs: path: coverage_slow.xml CodecovUpload: - needs: [Build_and_Unit, Acceptance, Integration, Doc, Slow] + needs: [Normal, Slow] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 895b23216ed67d13cf54eee8f9522d430ab8c048 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 20:53:14 -0300 Subject: [PATCH 27/34] WIP: trying to speedup code --- .github/workflows/test_pytest.yaml | 53 +++++++++++++++--------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index e27dac708..94320b818 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -28,42 +28,42 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: pip + - name: Cache Python dependencies + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install rocketpy run: pip install . + - name: Test importing rocketpy run: python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')" + - name: Install test dependencies run: pip install -r requirements-tests.txt + - name: Run Unit Tests - run: pytest -k "unit" --cov=rocketpy --cov-report=xml:./coverage_unit.xml - - name: Upload coverage to artifacts - uses: actions/upload-artifact@v2 - with: - name: coverage-build-and-unit - path: coverage_unit.xml + run: pytest tests/unit --cov=rocketpy --cov-report=xml + - name: Run Integration Tests - run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml:./coverage_integr.xml - - name: Upload coverage to artifacts - uses: actions/upload-artifact@v2 - with: - name: coverage-integration - path: coverage_integr.xml + run: pytest tests -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml --append + - name: Run Acceptance Tests - run: pytest --cov=rocketpy --cov-report=xml:./coverage_accept.xml - - name: Upload coverage to artifacts - uses: actions/upload-artifact@v2 - with: - name: coverage-acceptance - path: coverage_accept.xml + run: pytest tests/acceptance --cov=rocketpy --cov-report=xml --append + - name: Run Documentation Tests run: | cd rocketpy - pytest --doctest-modules --cov=rocketpy --cov-report=xml:./coverage_docs.xml + pytest --doctest-modules --cov=rocketpy --cov-report=xml --append + - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: - name: coverage-docs - path: coverage_docs.xml + name: coverage-normal + path: coverage.xml Slow: needs: Normal runs-on: ${{ matrix.os }} @@ -76,20 +76,24 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - uses: actions/checkout@v2 + - name: Set up Python uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} cache: pip + - name: Install dependencies run: | pip install . pip install -r requirements-tests.txt pip install -r requirements-optional.txt + - name: Run pytest --runslow if: github.ref == 'refs/heads/master' run: | - pytest -m slow --runslow --cov=rocketpy --cov-report=xml:./coverage_slow.xml + pytest tests -m slow --runslow --cov=rocketpy --cov-report=xml:./coverage_slow.xml + - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: @@ -108,8 +112,5 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} files: | - coverage_unit.xml - coverage_accept.xml - coverage_integr.xml - coverage_docs.xml + coverage.xml coverage_slow.xml From c4d99245739632bc48101263fde7dd37dd328c12 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 21:08:09 -0300 Subject: [PATCH 28/34] WIP: Update test_pytest.yaml to improve test coverage --- .github/workflows/test_pytest.yaml | 51 ++++++------------------------ 1 file changed, 10 insertions(+), 41 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 94320b818..9e4abf282 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -1,4 +1,4 @@ -name: PyTest +name: Tests on: pull_request: @@ -12,7 +12,7 @@ defaults: shell: bash jobs: - Normal: + Pytest: runs-on: ${{ matrix.os }} strategy: matrix: @@ -46,62 +46,32 @@ jobs: run: pip install -r requirements-tests.txt - name: Run Unit Tests - run: pytest tests/unit --cov=rocketpy --cov-report=xml + run: pytest tests/unit --cov=rocketpy - name: Run Integration Tests - run: pytest tests -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml --append + run: pytest $(find tests -maxdepth 1 -name "*.py") --cov=rocketpy --cov-append - name: Run Acceptance Tests - run: pytest tests/acceptance --cov=rocketpy --cov-report=xml --append + run: pytest tests/acceptance --cov=rocketpy --cov-append - name: Run Documentation Tests run: | cd rocketpy - pytest --doctest-modules --cov=rocketpy --cov-report=xml --append - - - name: Upload coverage to artifacts - uses: actions/upload-artifact@v2 - with: - name: coverage-normal - path: coverage.xml - Slow: - needs: Normal - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.8, 3.12] - env: - OS: ${{ matrix.os }} - PYTHON: ${{ matrix.python-version }} - steps: - - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - cache: pip - - - name: Install dependencies - run: | - pip install . - pip install -r requirements-tests.txt - pip install -r requirements-optional.txt + pytest --doctest-modules --cov=rocketpy --cov-append --cov-report=xml - name: Run pytest --runslow if: github.ref == 'refs/heads/master' run: | - pytest tests -m slow --runslow --cov=rocketpy --cov-report=xml:./coverage_slow.xml + pytest tests -m slow --runslow --cov=rocketpy --cov-append --cov-report=xml - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 with: - name: coverage-slow - path: coverage_slow.xml + name: coverage + path: coverage.xml CodecovUpload: - needs: [Normal, Slow] + needs: Pytest runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -113,4 +83,3 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: | coverage.xml - coverage_slow.xml From be91e8b09399c435801db2d132b3fb8f63e8ce49 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 21:28:33 -0300 Subject: [PATCH 29/34] WIP: update checkout version --- .github/workflows/test_pytest.yaml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 9e4abf282..5272a2557 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -22,19 +22,12 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} cache: pip - - name: Cache Python dependencies - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - name: Install rocketpy run: pip install . @@ -51,13 +44,15 @@ jobs: - name: Run Integration Tests run: pytest $(find tests -maxdepth 1 -name "*.py") --cov=rocketpy --cov-append - - name: Run Acceptance Tests - run: pytest tests/acceptance --cov=rocketpy --cov-append - - name: Run Documentation Tests run: | cd rocketpy - pytest --doctest-modules --cov=rocketpy --cov-append --cov-report=xml + pytest --doctest-modules --cov=rocketpy --cov-append + + - name: Run Acceptance Tests + run: | + cd .. + pytest tests/acceptance --cov=rocketpy --cov-append --cov-report=xml - name: Run pytest --runslow if: github.ref == 'refs/heads/master' @@ -74,7 +69,7 @@ jobs: needs: Pytest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Download all coverage reports uses: actions/download-artifact@v2 - name: Upload to Codecov From d3f2a254ae0cd75e2ecf8406edd47ec617d09628 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 21:47:42 -0300 Subject: [PATCH 30/34] WIP: Add directory change to fix pytest command --- .github/workflows/test_pytest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 5272a2557..15f69b7ce 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -48,10 +48,10 @@ jobs: run: | cd rocketpy pytest --doctest-modules --cov=rocketpy --cov-append + cd .. - name: Run Acceptance Tests run: | - cd .. pytest tests/acceptance --cov=rocketpy --cov-append --cov-report=xml - name: Run pytest --runslow From 1f695007169903b6a1b0cd7ff353e6da5bf83c4e Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 22:00:02 -0300 Subject: [PATCH 31/34] WIP: Add cache for Python dependencies in GitHub Actions workflow --- .github/workflows/test_pytest.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 15f69b7ce..2c9e97b21 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -27,7 +27,14 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - cache: pip + + - name: Cache Python dependencies + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-tests.txt') }} + restore-keys: | + ${{ runner.os }}-pip- - name: Install rocketpy run: pip install . From 0bb7cf75a09b97fd7d2cbade53923b03e19097b5 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 22:24:22 -0300 Subject: [PATCH 32/34] WIP: docs tests were not being captured --- .github/workflows/test_pytest.yaml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index 2c9e97b21..9934c53a6 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -52,19 +52,14 @@ jobs: run: pytest $(find tests -maxdepth 1 -name "*.py") --cov=rocketpy --cov-append - name: Run Documentation Tests - run: | - cd rocketpy - pytest --doctest-modules --cov=rocketpy --cov-append - cd .. + run: pytest rocketpy --doctest-modules --cov=rocketpy --cov-append - name: Run Acceptance Tests - run: | - pytest tests/acceptance --cov=rocketpy --cov-append --cov-report=xml + run: pytest tests/acceptance --cov=rocketpy --cov-append --cov-report=xml - name: Run pytest --runslow if: github.ref == 'refs/heads/master' - run: | - pytest tests -m slow --runslow --cov=rocketpy --cov-append --cov-report=xml + run: pytest tests -m slow --runslow --cov=rocketpy --cov-append --cov-report=xml - name: Upload coverage to artifacts uses: actions/upload-artifact@v2 From 397e299038c306ed45f2865ad06a0b8f953df7dd Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Sun, 17 Dec 2023 23:01:15 -0300 Subject: [PATCH 33/34] MNT: Add codecov.yml configuration file --- .github/workflows/codecov.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/codecov.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 000000000..2ec5f6c56 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,35 @@ +coverage: + status: + project: + default: + # basic + target: auto + threshold: 1% + base: auto + flags: + - unit + paths: + - "rocketpy" + # advanced settings + branches: + - master + - develop + if_ci_failed: error #success, failure, error, ignore + informational: false + only_pulls: false + patch: + default: + # basic + target: auto + threshold: 1% + base: auto + # advanced + branches: + - master + - develop + if_ci_failed: error #success, failure, error, ignore + only_pulls: false + flags: + - "unit" + paths: + - "rocketpy" From e1c6d6f8b73e61b8c5e05df70ae6bfe0fa0806cc Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Tue, 19 Dec 2023 21:47:49 -0300 Subject: [PATCH 34/34] MNT: Update Python version to 3.8 when running black linter --- .github/workflows/lint_black.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint_black.yaml b/.github/workflows/lint_black.yaml index 49a322991..975efd83c 100644 --- a/.github/workflows/lint_black.yaml +++ b/.github/workflows/lint_black.yaml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: 3.10.13 + python-version: 3.8 - name: Install Python dependencies run: pip install black[jupyter]