From 447c5789bdaf092dca6af7282bb20931999ff456 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 29 Jun 2025 13:04:28 +0200 Subject: [PATCH] fix(ci): add install-minimum-git-version helper for workflows (#8345) https://codeberg.org/forgejo-integration/forgejo/actions/runs/10592#jobstep-3-14 failed with > E: Packages were downgraded and -y was used without --allow-downgrades. Running the tests is done following the instructions in the workflow: ``` # - uncomment [on].pull_request # - swap 'forgejo-integration' and 'forgejo-coding' # - open a pull request at https://codeberg.org/forgejo/forgejo and fix things # - swap 'forgejo-integration' and 'forgejo-coding' # - comment [on].pull_request ``` The result of the test is available at https://codeberg.org/forgejo/forgejo/actions/runs/85408/jobs/0 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8345 Reviewed-by: Gusted Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .../install-minimum-git-version/action.yaml | 22 ++++++++++++++++++ .forgejo/workflows/testing-integration.yml | 23 ++++--------------- 2 files changed, 26 insertions(+), 19 deletions(-) create mode 100644 .forgejo/workflows-composite/install-minimum-git-version/action.yaml diff --git a/.forgejo/workflows-composite/install-minimum-git-version/action.yaml b/.forgejo/workflows-composite/install-minimum-git-version/action.yaml new file mode 100644 index 0000000000..d4e6e3f2a7 --- /dev/null +++ b/.forgejo/workflows-composite/install-minimum-git-version/action.yaml @@ -0,0 +1,22 @@ +# +# Install the minimal version of Git supported by Forgejo +# +runs: + using: "composite" + steps: + - name: install git and git-lfs + run: | + set -x + + export DEBIAN_FRONTEND=noninteractive + + apt-get update -qq + apt-get -q install -y -qq curl ca-certificates + + curl -sS -o /tmp/git-man.deb http://archive.ubuntu.com/ubuntu/pool/main/g/git/git-man_2.34.1-1ubuntu1_all.deb + curl -sS -o /tmp/git.deb https://archive.ubuntu.com/ubuntu/pool/main/g/git/git_2.34.1-1ubuntu1_amd64.deb + curl -sS -o /tmp/git-lfs.deb https://archive.ubuntu.com/ubuntu/pool/universe/g/git-lfs/git-lfs_3.0.2-1_amd64.deb + + apt-get -q install --allow-downgrades -y -qq /tmp/git-man.deb + apt-get -q install --allow-downgrades -y -qq /tmp/git.deb + apt-get -q install --allow-downgrades -y -qq /tmp/git-lfs.deb diff --git a/.forgejo/workflows/testing-integration.yml b/.forgejo/workflows/testing-integration.yml index 630de50435..102a2d9774 100644 --- a/.forgejo/workflows/testing-integration.yml +++ b/.forgejo/workflows/testing-integration.yml @@ -33,20 +33,8 @@ jobs: steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/workflows-composite/setup-env - - name: install git 2.34.1 - run: | - export DEBIAN_FRONTEND=noninteractive - - apt-get update -qq - apt-get -q install -y -qq curl ca-certificates - - curl -sS -o git-man.deb http://archive.ubuntu.com/ubuntu/pool/main/g/git/git-man_2.34.1-1ubuntu1_all.deb - curl -sS -o git.deb https://archive.ubuntu.com/ubuntu/pool/main/g/git/git_2.34.1-1ubuntu1_amd64.deb - curl -sS -o git-lfs.deb https://archive.ubuntu.com/ubuntu/pool/universe/g/git-lfs/git-lfs_3.0.2-1_amd64.deb - - apt-get -q install -y -qq ./git-man.deb - apt-get -q install -y -qq ./git.deb - apt-get -q install -y -qq ./git-lfs.deb + - name: install git 2.34.1 and git-lfs 3.0.2 + uses: ./.forgejo/workflows-composite/install-minimum-git-version - uses: ./.forgejo/workflows-composite/build-backend - run: | su forgejo -c 'make test-backend test-check' @@ -64,11 +52,8 @@ jobs: steps: - uses: https://data.forgejo.org/actions/checkout@v4 - uses: ./.forgejo/workflows-composite/setup-env - - name: install git 2.30 - uses: ./.forgejo/workflows-composite/apt-install-from - with: - packages: git/bullseye git-lfs/bullseye - release: bullseye + - name: install git 2.34.1 and git-lfs 3.0.2 + uses: ./.forgejo/workflows-composite/install-minimum-git-version - uses: ./.forgejo/workflows-composite/build-backend - run: | su forgejo -c 'make test-sqlite-migration test-sqlite'