1name: Integration tests for the release process23on:4 push:5 paths:6 - go.mod7 - Dockerfile8 - .forgejo/workflows/build-release.yml9 - .forgejo/workflows/build-release-integration.yml10 pull_request:11 paths:12 - go.mod13 - Dockerfile14 - .forgejo/workflows/build-release.yml15 - .forgejo/workflows/build-release-integration.yml1617jobs:18 release-simulation:19 runs-on: self-hosted20 if: github.repository_owner != 'forgejo-integration' && github.repository_owner != 'forgejo-release'21 steps:22 - uses: actions/checkout@v32324 - id: forgejo25 uses: https://code.forgejo.org/actions/setup-forgejo@v126 with:27 user: root28 password: admin123429 image-version: 1.2030 lxc-ip-prefix: 10.0.93132 - name: publish33 run: |34 set -x3536 version=1.2.337 cat > /etc/docker/daemon.json <<EOF38 {39 "insecure-registries" : ["${{ steps.forgejo.outputs.host-port }}"]40 }41 EOF42 systemctl restart docker4344 dir=$(mktemp -d)45 trap "rm -fr $dir" EXIT4647 url=http://root:admin1234@${{ steps.forgejo.outputs.host-port }}48 export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}"4950 #51 # Create a new project with the runner and the release workflow only52 #53 rsync -a --exclude .git ./ $dir/54 rm $(find $dir/.forgejo/workflows/*.yml | grep -v build-release.yml)55 forgejo-test-helper.sh push $dir $url root runner56 sha=$(forgejo-test-helper.sh branch_tip $url root/runner main)5758 #59 # Push a tag to trigger the release workflow and wait for it to complete60 #61 forgejo-curl.sh api_json --data-raw '{"tag_name": "v'$version'", "target": "'$sha'"}' $url/api/v1/repos/root/runner/tags62 LOOPS=180 forgejo-test-helper.sh wait_success "$url" root/runner $sha6364 #65 # uncomment to see the logs even when everything is reported to be working ok66 #67 #cat $FORGEJO_RUNNER_LOGS6869 #70 # Minimal sanity checks. e2e test is for the setup-forgejo action71 #72 for arch in amd64 arm64 ; do73 binary=forgejo-runner-$version-linux-$arch74 for suffix in '' '.xz' ; do75 curl --fail -L -sS $url/root/runner/releases/download/v$version/$binary$suffix > $binary$suffix76 if test "$suffix" = .xz ; then77 unxz --keep $binary$suffix78 fi79 chmod +x $binary80 ./$binary --version | grep $version81 curl --fail -L -sS $url/root/runner/releases/download/v$version/$binary$suffix.sha256 > $binary$suffix.sha25682 shasum -a 256 --check $binary$suffix.sha25683 rm $binary$suffix84 done85 done8687 docker pull ${{ steps.forgejo.outputs.host-port }}/root/runner:$version8889 docker inspect ${{ steps.forgejo.outputs.host-port}}/root/runner:$version > labels.json90 python3 .forgejo/labelscompare.py