From 5c17337595d2f3d8c410683c54899afb0a984db4 Mon Sep 17 00:00:00 2001 From: imperosol Date: Thu, 30 Apr 2026 18:40:46 +0200 Subject: [PATCH] update CI --- .github/actions/setup_project/action.yml | 38 ++++++++++-------------- .github/workflows/ci.yml | 8 ++--- .github/workflows/deploy.yml | 4 +-- .github/workflows/deploy_docs.yml | 4 +-- .github/workflows/taiste.yml | 4 +-- 5 files changed, 24 insertions(+), 34 deletions(-) diff --git a/.github/actions/setup_project/action.yml b/.github/actions/setup_project/action.yml index 0ec83445..720d36bc 100644 --- a/.github/actions/setup_project/action.yml +++ b/.github/actions/setup_project/action.yml @@ -12,7 +12,7 @@ runs: steps: - name: Install apt packages if: ${{ inputs.full == 'true' }} - uses: awalsh128/cache-apt-pkgs-action@v1.4.3 + uses: awalsh128/cache-apt-pkgs-action@v1.6.0 with: packages: gettext version: 1.0 # increment to reset cache @@ -23,26 +23,29 @@ runs: with: redis-version: "7.x" - - name: Install uv - uses: astral-sh/setup-uv@v5 - with: - version: "0.5.14" - enable-cache: true - cache-dependency-glob: "uv.lock" - - name: "Set up Python" - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version-file: ".python-version" - - name: Restore cached virtualenv - uses: actions/cache/restore@v4 + - name: Install uv + uses: astral-sh/setup-uv@v8.1.0 + with: + version: "0.11.8" + enable-cache: false + cache-dependency-glob: "uv.lock" + + - name: Restore cached virtualenv + uses: actions/cache@v5 with: - key: venv-${{ runner.os }}-${{ hashFiles('.python-version') }}-${{ hashFiles('pyproject.toml') }}-${{ env.CACHE_SUFFIX }} path: .venv + key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} + restore-keys: | + uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} + uv-${{ runner.os }} - name: Install dependencies - run: uv sync + run: uv sync --locked shell: bash - name: Install Xapian @@ -50,15 +53,6 @@ runs: run: uv run ./manage.py install_xapian shell: bash - # compiling xapian accounts for almost the entirety of the virtualenv setup, - # so we save the virtual environment only on workflows where it has been installed - - name: Save cached virtualenv - if: ${{ inputs.full == 'true' }} - uses: actions/cache/save@v4 - with: - key: venv-${{ runner.os }}-${{ hashFiles('.python-version') }}-${{ hashFiles('pyproject.toml') }}-${{ env.CACHE_SUFFIX }} - path: .venv - - name: Compile gettext messages if: ${{ inputs.full == 'true' }} run: uv run ./manage.py compilemessages diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8919d04c..e92bf82e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,8 +18,8 @@ jobs: name: Launch pre-commits checks (ruff) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version-file: ".python-version" - uses: pre-commit/action@v3.0.1 @@ -35,7 +35,7 @@ jobs: pytest-mark: [not slow] steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - uses: ./.github/actions/setup_project with: full: true @@ -49,7 +49,7 @@ jobs: uv run coverage report uv run coverage html - name: Archive code coverage results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: coverage-report-${{ matrix.pytest-mark }} path: coverage_report diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8df48378..d46feb8a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,7 +14,7 @@ jobs: steps: - name: SSH Remote Commands - uses: appleboy/ssh-action@v1.1.0 + uses: appleboy/ssh-action@v1.2.5 with: # Proxy proxy_host : ${{secrets.PROXY_HOST}} @@ -29,8 +29,6 @@ jobs: username : ${{secrets.USER}} key: ${{secrets.KEY}} - script_stop: true - # See https://github.com/ae-utbm/sith/wiki/GitHub-Actions#deployment-action script: | cd ${{secrets.SITH_PATH}} diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 236917a3..cae93e7b 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -9,10 +9,10 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/actions/setup_project - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - - uses: actions/cache@v3 + - uses: actions/cache@v5 with: key: mkdocs-material-${{ env.cache_id }} path: .cache diff --git a/.github/workflows/taiste.yml b/.github/workflows/taiste.yml index 729e051c..9a49c8f3 100644 --- a/.github/workflows/taiste.yml +++ b/.github/workflows/taiste.yml @@ -13,7 +13,7 @@ jobs: steps: - name: SSH Remote Commands - uses: appleboy/ssh-action@v1.1.0 + uses: appleboy/ssh-action@v1.2.5 with: # Proxy proxy_host : ${{secrets.PROXY_HOST}} @@ -28,8 +28,6 @@ jobs: username : ${{secrets.USER}} key: ${{secrets.KEY}} - script_stop: true - # See https://github.com/ae-utbm/sith/wiki/GitHub-Actions#deployment-action script: | cd ${{secrets.SITH_PATH}}