on: [ pull_request, push ] jobs: integration: runs-on: self-hosted steps: - uses: actions/checkout@v3 - id: forgejo uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.3 with: user: testuser password: admin1234 image-version: 9 - name: push self run: | forgejo-test-helper.sh push_self_action http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser forgejo-release vTest - name: testdata/upload-download run: | export LOOP_DELAY=30 export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}" forgejo-test-helper.sh run_workflow testdata/upload-download http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser upload-download forgejo-release "${{ steps.forgejo.outputs.token }}" set -ex export FORGEJO="${{ steps.forgejo.outputs.url }}" curl --fail -sS $FORGEJO/api/v1/repos/testuser/upload-download/releases/tags/v2.0 > /tmp/v2.json EXPECTED='No shell expansion should on these notes: - $(some_command) - `other_commend` - "double quoted" and '\''single quoted'\'' strings - \backslash escape - !exclamation_mark' test "$EXPECTED" = "$(jq -r .body < /tmp/v2.json)" test $(cat /tmp/v2.json | jq -r .hide_archive_links) = false curl --fail -sS $FORGEJO/api/v1/repos/testuser/upload-download/releases/tags/v1.0 > /tmp/v1.json cat /tmp/v1.json | jq -r .body | grep '' test $(cat /tmp/v1.json | jq -r .hide_archive_links) = true - name: testdata/upload-download-private run: | export LOOP_DELAY=30 export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}" curl -X 'POST' 'http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }}/api/v1/user/repos' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"name": "upload-download-private","private": true}' forgejo-test-helper.sh run_workflow testdata/upload-download http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser upload-download-private forgejo-release "${{ steps.forgejo.outputs.token }}" - name: testdata/nested-upload-download run: | export LOOP_DELAY=30 export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}" forgejo-test-helper.sh run_workflow testdata/nested-upload-download http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser nested-upload-download forgejo-release "${{ steps.forgejo.outputs.token }}" - name: test forgejo-release.sh run: | set -ex export FORGEJO="${{ steps.forgejo.outputs.url }}" export TOKEN="${{ steps.forgejo.outputs.token }}" export VERBOSE=true testdata/forgejo-release-test.sh test_run testuser otherrepo - if: failure() run: docker logs forgejo