mirror of
https://code.forgejo.org/actions/forgejo-release.git
synced 2024-12-23 03:05:27 +00:00
non nested upload/download tests
This commit is contained in:
parent
df1717d07c
commit
3a07a6062f
|
@ -15,6 +15,7 @@ jobs:
|
||||||
set -ex
|
set -ex
|
||||||
export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}"
|
export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}"
|
||||||
forgejo-test-helper.sh push_self_action http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser forgejo-release vTest
|
forgejo-test-helper.sh push_self_action http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser forgejo-release vTest
|
||||||
|
forgejo-test-helper.sh run_workflow testdata/upload-download http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser upload-download forgejo-release
|
||||||
forgejo-test-helper.sh run_workflow testdata/nested-upload-download http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser nested-upload-download forgejo-release
|
forgejo-test-helper.sh run_workflow testdata/nested-upload-download http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser nested-upload-download forgejo-release
|
||||||
- name: 002
|
- name: 002
|
||||||
run: |
|
run: |
|
||||||
|
|
16
action.yml
16
action.yml
|
@ -5,10 +5,8 @@ description: |
|
||||||
inputs:
|
inputs:
|
||||||
url:
|
url:
|
||||||
description: 'URL of the Forgejo instance'
|
description: 'URL of the Forgejo instance'
|
||||||
required: true
|
|
||||||
repo:
|
repo:
|
||||||
description: 'owner/project relative to the URL'
|
description: 'owner/project relative to the URL'
|
||||||
required: true
|
|
||||||
tag:
|
tag:
|
||||||
description: 'Tag of the release'
|
description: 'Tag of the release'
|
||||||
required: true
|
required: true
|
||||||
|
@ -38,13 +36,27 @@ runs:
|
||||||
shell: bash
|
shell: bash
|
||||||
- run: |
|
- run: |
|
||||||
export FORGEJO="${{ inputs.url }}"
|
export FORGEJO="${{ inputs.url }}"
|
||||||
|
if test -z "$FORGEJO"; then
|
||||||
|
export FORGEJO="${{ github.server_url }}"
|
||||||
|
fi
|
||||||
export REPO="${{ inputs.repo }}"
|
export REPO="${{ inputs.repo }}"
|
||||||
|
if test -z "$REPO"; then
|
||||||
|
export REPO="${{ github.repository }}"
|
||||||
|
fi
|
||||||
export TAG="${{ inputs.tag }}"
|
export TAG="${{ inputs.tag }}"
|
||||||
export DOER="${{ inputs.doer }}"
|
export DOER="${{ inputs.doer }}"
|
||||||
export TOKEN="${{ inputs.token }}"
|
export TOKEN="${{ inputs.token }}"
|
||||||
|
if test -z "$TOKEN"; then
|
||||||
|
export TOKEN="${{ github.token }}"
|
||||||
|
fi
|
||||||
|
if test -z "$TOKEN"; then
|
||||||
|
export TOKEN="${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
fi
|
||||||
|
test "$TOKEN"
|
||||||
export RELEASE_DIR="${{ inputs.release-dir }}"
|
export RELEASE_DIR="${{ inputs.release-dir }}"
|
||||||
export RELEASENOTES="${{ inputs.release-notes }}"
|
export RELEASENOTES="${{ inputs.release-notes }}"
|
||||||
export VERBOSE="${{ inputs.verbose }}"
|
export VERBOSE="${{ inputs.verbose }}"
|
||||||
|
|
||||||
export SHA="${{ inputs.sha }}"
|
export SHA="${{ inputs.sha }}"
|
||||||
if test -z "$SHA"; then
|
if test -z "$SHA"; then
|
||||||
export SHA="${{ github.sha }}"
|
export SHA="${{ github.sha }}"
|
||||||
|
|
28
testdata/upload-download/.forgejo/workflows/test.yml
vendored
Normal file
28
testdata/upload-download/.forgejo/workflows/test.yml
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
name: Upload & Download a Forgejo Release
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
setup-forgejo:
|
||||||
|
runs-on: self-hosted
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- id: release-upload
|
||||||
|
uses: SELF@vTest
|
||||||
|
with:
|
||||||
|
url: FORGEJO_URL
|
||||||
|
direction: upload
|
||||||
|
tag: v1.0
|
||||||
|
doer: testuser
|
||||||
|
release-dir: upload-dir
|
||||||
|
release-notes: "RELEASE NOTES"
|
||||||
|
verbose: true
|
||||||
|
- id: release-download
|
||||||
|
uses: SELF@vTest
|
||||||
|
with:
|
||||||
|
url: FORGEJO_URL
|
||||||
|
direction: download
|
||||||
|
tag: v1.0
|
||||||
|
doer: testuser
|
||||||
|
release-dir: download-dir
|
||||||
|
verbose: true
|
||||||
|
- run: |
|
||||||
|
diff -u upload-dir download-dir
|
1
testdata/upload-download/upload-dir/file1.txt
vendored
Normal file
1
testdata/upload-download/upload-dir/file1.txt
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
FILE1
|
1
testdata/upload-download/upload-dir/file2.txt
vendored
Normal file
1
testdata/upload-download/upload-dir/file2.txt
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
FILE2
|
Loading…
Reference in a new issue