2024-01-03 15:45:50 -05:00
|
|
|
on: [ pull_request, push ]
|
2023-03-26 11:41:37 -04:00
|
|
|
jobs:
|
|
|
|
integration:
|
|
|
|
runs-on: self-hosted
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-05-26 08:48:58 -04:00
|
|
|
|
2023-03-26 11:41:37 -04:00
|
|
|
- id: forgejo
|
2024-11-27 19:02:39 -05:00
|
|
|
uses: https://code.forgejo.org/actions/setup-forgejo@v2.0.3
|
2023-03-26 11:41:37 -04:00
|
|
|
with:
|
2023-03-26 17:03:56 -04:00
|
|
|
user: testuser
|
2023-03-27 11:17:17 -04:00
|
|
|
password: admin1234
|
2024-11-18 05:25:18 -05:00
|
|
|
image-version: 9
|
2023-03-30 11:27:35 -04:00
|
|
|
|
2023-09-02 01:42:49 -04:00
|
|
|
- name: push self
|
2023-03-27 11:17:17 -04:00
|
|
|
run: |
|
2023-03-29 11:16:26 -04:00
|
|
|
forgejo-test-helper.sh push_self_action http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser forgejo-release vTest
|
2023-03-30 11:27:35 -04:00
|
|
|
|
2023-09-02 01:42:49 -04:00
|
|
|
- name: testdata/upload-download
|
2023-03-30 11:27:35 -04:00
|
|
|
run: |
|
2024-11-18 05:10:44 -05:00
|
|
|
export LOOP_DELAY=30
|
2023-03-30 11:27:35 -04:00
|
|
|
export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}"
|
2023-03-30 10:28:59 -04:00
|
|
|
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 }}"
|
2023-03-30 11:27:35 -04:00
|
|
|
|
2024-08-11 03:05:40 -04:00
|
|
|
set -ex
|
|
|
|
export FORGEJO="${{ steps.forgejo.outputs.url }}"
|
2024-11-19 10:38:34 -05:00
|
|
|
curl --fail -sS $FORGEJO/api/v1/repos/testuser/upload-download/releases/tags/v2.0 > /tmp/v2.json
|
2024-08-11 03:05:40 -04:00
|
|
|
EXPECTED='No shell expansion should on these notes:
|
|
|
|
- $(some_command)
|
|
|
|
- `other_commend`
|
|
|
|
- "double quoted" and '\''single quoted'\'' strings
|
|
|
|
- \backslash escape
|
|
|
|
- !exclamation_mark'
|
2024-11-19 10:38:34 -05:00
|
|
|
test "$EXPECTED" = "$(jq -r .body < /tmp/v2.json)"
|
|
|
|
|
|
|
|
test $(cat /tmp/v2.json | jq -r .hide_archive_links) = false
|
2024-08-11 03:05:40 -04:00
|
|
|
|
2024-11-18 05:31:53 -05:00
|
|
|
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 '<!--start release-notes-assistant-->'
|
|
|
|
|
2024-11-19 10:38:34 -05:00
|
|
|
test $(cat /tmp/v1.json | jq -r .hide_archive_links) = true
|
|
|
|
|
2024-07-06 16:04:23 -04:00
|
|
|
- name: testdata/upload-download-private
|
|
|
|
run: |
|
2024-11-18 05:10:44 -05:00
|
|
|
export LOOP_DELAY=30
|
2024-07-06 16:04:23 -04:00
|
|
|
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 }}"
|
|
|
|
|
2023-09-02 01:42:49 -04:00
|
|
|
- name: testdata/nested-upload-download
|
2023-03-30 11:27:35 -04:00
|
|
|
run: |
|
2024-11-18 05:10:44 -05:00
|
|
|
export LOOP_DELAY=30
|
2023-03-30 11:27:35 -04:00
|
|
|
export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}"
|
2023-03-30 10:28:59 -04:00
|
|
|
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 }}"
|
2023-03-30 11:27:35 -04:00
|
|
|
|
2023-09-02 01:42:49 -04:00
|
|
|
- name: test forgejo-release.sh
|
2023-03-27 11:17:17 -04:00
|
|
|
run: |
|
2023-03-26 11:41:37 -04:00
|
|
|
set -ex
|
2023-03-26 17:03:56 -04:00
|
|
|
export FORGEJO="${{ steps.forgejo.outputs.url }}"
|
2023-03-29 19:08:18 -04:00
|
|
|
export TOKEN="${{ steps.forgejo.outputs.token }}"
|
|
|
|
export VERBOSE=true
|
|
|
|
testdata/forgejo-release-test.sh test_run testuser otherrepo
|
2023-09-02 04:48:52 -04:00
|
|
|
|
|
|
|
- if: failure()
|
|
|
|
run: docker logs forgejo
|