From d841fc1c9a35bc892f67474ffa51e7cb1f96e382 Mon Sep 17 00:00:00 2001 From: Olivier DEBAUCHE Date: Fri, 26 Jul 2024 23:52:16 +0200 Subject: [PATCH] tests speed up --- ...ghtlies.yml => nighlies_deep_learning.yml} | 15 +--- .github/workflows/nightlies_common.yml | 81 +++++++++++++++++++ 2 files changed, 83 insertions(+), 13 deletions(-) rename .github/workflows/{nightlies.yml => nighlies_deep_learning.yml} (97%) create mode 100644 .github/workflows/nightlies_common.yml diff --git a/.github/workflows/nightlies.yml b/.github/workflows/nighlies_deep_learning.yml similarity index 97% rename from .github/workflows/nightlies.yml rename to .github/workflows/nighlies_deep_learning.yml index 5cd236f6..ea3f096a 100644 --- a/.github/workflows/nightlies.yml +++ b/.github/workflows/nighlies_deep_learning.yml @@ -46,20 +46,9 @@ jobs: python -m pip install uv python -m uv pip install coverage python -m uv pip install -r tests.txt - - name: Coverage FL_Client - run: | + - name: Coverage Erase + run: | coverage erase - coverage run manage.py test --parallel auto fl_client.tests.tests_urls - coverage combine -a - coverage run manage.py test --parallel auto fl_client.tests.tests_views - coverage combine -a - - name: Coverage FL_Server - run: | - coverage run manage.py test --parallel auto fl_server.tests.tests_urls - coverage combine -a - coverage run manage.py test --parallel auto fl_server.tests.tests_views - coverage combine -a - # coverage run -a manage.py test --parallel auto fl_server.tests.tests_server - name: Coverage A run: | coverage run manage.py test --parallel auto fl_common.tests.tests_models_alexnet diff --git a/.github/workflows/nightlies_common.yml b/.github/workflows/nightlies_common.yml new file mode 100644 index 00000000..9bbaa1e4 --- /dev/null +++ b/.github/workflows/nightlies_common.yml @@ -0,0 +1,81 @@ +name: Nighlies Common +on: + schedule: + - cron: "0 00 * * *" # 12am UTC, 5:30pm Indian, 9pm Brazil, 11am AEDT + workflow_dispatch: + inputs: + none: + description: "Nighlies Common" + required: false + +concurrency: + group: nightlies-common-${{ github.event_name == 'pull_request' && format('{0}-{1}', github.workflow, github.event.pull_request.number) || github.workflow_ref }} + cancel-in-progress: true + +jobs: + sonarcloud: + name: Coverage + runs-on: ubuntu-latest + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: false + swap-storage: true + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: 3.12 + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install uv + python -m uv pip install coverage + python -m uv pip install -r tests.txt + - name: Coverage Erase + run: | + coverage erase + - name: Coverage FL_Client + run: | + coverage run manage.py test --parallel auto fl_client.tests.tests_urls + coverage combine -a + coverage run manage.py test --parallel auto fl_client.tests.tests_views + coverage combine -a + - name: Coverage FL_Server + run: | + coverage run manage.py test --parallel auto fl_server.tests.tests_urls + coverage combine -a + coverage run manage.py test --parallel auto fl_server.tests.tests_views + coverage combine -a + # coverage run -a manage.py test --parallel auto fl_server.tests.tests_server + - name: Coverage Report + run: | + coverage xml -o coverage.xml + coverage report + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Run codacy-coverage-reporter + uses: codacy/codacy-coverage-reporter-action@v1.3.0 + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + coverage-reports: 'coverage.xml' + env: + CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} +