From ec3ca1a055ec6d5ea539bb947a18fb270dea1c29 Mon Sep 17 00:00:00 2001 From: REDCODE Date: Fri, 7 Aug 2026 01:53:09 +0200 Subject: [PATCH] Fixed CI to run on gitea --- .github/workflows/ci.yml | 64 +++++++++++++++++++++------------------- src/spice2x/build_all.sh | 1 + 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b08cf7..6aa75bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,32 +1,34 @@ -on: [push, pull_request] -name: Continuous Integration -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - fw-ci: - name: Build - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./src/spice2x - steps: - - uses: actions/checkout@v5 - - name: Set ccache environment variables - run: | - echo "CCACHE_DIR=${{ github.workspace }}/src/spice2x/.ccache" >> $GITHUB_ENV - - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.23 - - name: Calculate commit SHA - id: vars - run: | - calculatedSha=$(git rev-parse --short ${{ github.sha }}) - echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV - - name: Compile - run: ./build_docker.sh - - uses: actions/upload-artifact@v6 - with: - name: spice2x-ci-${{ env.COMMIT_SHORT_SHA }} - path: src/spice2x/bin +on: [push, pull_request] +name: Continuous Integration +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + fw-ci: + name: Build + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./src/spice2x + steps: + - uses: actions/checkout@v5 + - name: Calculate commit SHA + id: vars + run: | + calculatedSha=$(git rev-parse --short ${{ github.sha }}) + echo "sha=$calculatedSha" >> "$GITHUB_OUTPUT" + echo "bin=${{ github.workspace }}/src/spice2x/bin" >> "$GITHUB_OUTPUT" + - name: Compile + run: | + docker build --pull "$PWD/external/docker" -t spicetools/deps --platform linux/x86_64 + docker build --build-context gitroot="$PWD/../../.git" . -t spicetools/spice:latest + docker run --name spice-build spicetools/spice:latest + mkdir -p "$PWD/bin" + docker cp spice-build:/src/src/spice2x/bin/. "$PWD/bin" + docker rm spice-build + - uses: actions/upload-artifact@v3 + with: + name: spice2x-ci-${{ steps.vars.outputs.sha }} + path: ${{ steps.vars.outputs.bin }} if-no-files-found: error \ No newline at end of file diff --git a/src/spice2x/build_all.sh b/src/spice2x/build_all.sh index d269b89..ba9c9d8 100755 --- a/src/spice2x/build_all.sh +++ b/src/spice2x/build_all.sh @@ -40,6 +40,7 @@ done # settings GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2> /dev/null || echo "none") +GIT_BRANCH="${GIT_BRANCH//\//-}" GIT_HEAD=$(git rev-parse HEAD || echo "none") TOOLCHAIN_32="${TOOLCHAIN_32:-"/usr/share/mingw/toolchain-i686-w64-mingw32.cmake"}" TOOLCHAIN_64="${TOOLCHAIN_64:-"/usr/share/mingw/toolchain-x86_64-w64-mingw32.cmake"}"