forgejo-release/.forgejo/workflows/integration.yml

59 lines
2.7 KiB
YAML
Raw Normal View History

2024-01-03 20:45:50 +00:00
on: [ pull_request, push ]
jobs:
integration:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
2023-05-26 12:48:58 +00:00
- id: forgejo
uses: https://code.forgejo.org/actions/setup-forgejo@v1
with:
2023-03-26 21:03:56 +00:00
user: testuser
2023-03-27 15:17:17 +00:00
password: admin1234
2023-09-02 05:42:49 +00:00
image-version: 1.20
2023-03-30 15:27:35 +00:00
2023-09-02 05:42:49 +00:00
- name: push self
2023-03-27 15:17:17 +00:00
run: |
2023-03-29 15:16:26 +00:00
forgejo-test-helper.sh push_self_action http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser forgejo-release vTest
2023-03-30 15:27:35 +00:00
2023-09-02 05:42:49 +00:00
- name: testdata/upload-download
2023-03-30 15:27:35 +00:00
run: |
2024-11-12 16:38:02 +00:00
LOOP_DELAY=30
2023-03-30 15:27:35 +00:00
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 }}"
2023-03-30 15:27:35 +00:00
set -ex
export FORGEJO="${{ steps.forgejo.outputs.url }}"
curl --fail -sS $FORGEJO/api/v1/repos/testuser/upload-download/releases/tags/v2.0 > /tmp/release.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/release.json)"
- name: testdata/upload-download-private
run: |
2024-11-12 16:38:02 +00:00
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 }}"
2023-09-02 05:42:49 +00:00
- name: testdata/nested-upload-download
2023-03-30 15:27:35 +00:00
run: |
2024-11-12 16:38:02 +00:00
LOOP_DELAY=30
2023-03-30 15:27:35 +00:00
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 }}"
2023-03-30 15:27:35 +00:00
2023-09-02 05:42:49 +00:00
- name: test forgejo-release.sh
2023-03-27 15:17:17 +00:00
run: |
set -ex
2023-03-26 21:03:56 +00:00
export FORGEJO="${{ steps.forgejo.outputs.url }}"
2023-03-29 23:08:18 +00:00
export TOKEN="${{ steps.forgejo.outputs.token }}"
export VERBOSE=true
testdata/forgejo-release-test.sh test_run testuser otherrepo
2023-09-02 08:48:52 +00:00
- if: failure()
run: docker logs forgejo