mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-11-24 00:40:58 -05:00
add example of artifact usage
This commit is contained in:
parent
356d879c4d
commit
fc548f5117
4 changed files with 49 additions and 2 deletions
|
@ -8,7 +8,7 @@ jobs:
|
||||||
info:
|
info:
|
||||||
- version: "1.21.0-1-rc0"
|
- version: "1.21.0-1-rc0"
|
||||||
image: codeberg.org/forgejo-experimental/forgejo
|
image: codeberg.org/forgejo-experimental/forgejo
|
||||||
tests: "echo cron pull-request service container expression local-action docker-action if if-fail"
|
tests: "echo cron artifacts pull-request service container expression local-action docker-action if if-fail"
|
||||||
- version: "1.20"
|
- version: "1.20"
|
||||||
image: codeberg.org/forgejo/forgejo
|
image: codeberg.org/forgejo/forgejo
|
||||||
tests: "echo service container expression local-action docker-action if if-fail"
|
tests: "echo service container expression local-action docker-action if if-fail"
|
||||||
|
|
|
@ -102,6 +102,7 @@ because the tests run as root, but they do not need to run as root.
|
||||||
* `export example=pull-request`
|
* `export example=pull-request`
|
||||||
* `export EXAMPLE_DIR=$(pwd)/testdata/example-$example`
|
* `export EXAMPLE_DIR=$(pwd)/testdata/example-$example`
|
||||||
* `$EXAMPLE_DIR/setup.sh` # if it exists
|
* `$EXAMPLE_DIR/setup.sh` # if it exists
|
||||||
* `$EXAMPLE_DIR/run.sh`
|
* `$EXAMPLE_DIR/run.sh` or
|
||||||
|
* `forgejo-test-helper.sh run_workflow testdata/example-$example http://root:admin1234@$(cat forgejo-ip):3000 root example-$example setup-forgejo $(cat forgejo-token)`
|
||||||
* `forgejo-runner.sh teardown`
|
* `forgejo-runner.sh teardown`
|
||||||
* `forgejo.sh teardown`
|
* `forgejo.sh teardown`
|
||||||
|
|
22
testdata/example-artifacts/.forgejo/workflows/many.yml
vendored
Normal file
22
testdata/example-artifacts/.forgejo/workflows/many.yml
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
upload:
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- run: mkdir -p artifacts
|
||||||
|
|
||||||
|
- run: touch artifacts/ONE artifacts/TWO
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: many-artifacts
|
||||||
|
path: artifacts/
|
||||||
|
|
||||||
|
download:
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
|
||||||
|
- run: |
|
||||||
|
test -f many-artifacts/ONE
|
||||||
|
test -f many-artifacts/TWO
|
24
testdata/example-artifacts/.forgejo/workflows/one.yml
vendored
Normal file
24
testdata/example-artifacts/.forgejo/workflows/one.yml
vendored
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
upload:
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- run: mkdir -p path/to/artifact
|
||||||
|
|
||||||
|
- run: echo hello > path/to/artifact/world.txt
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: my-artifact
|
||||||
|
path: path/to/artifact/world.txt
|
||||||
|
|
||||||
|
download:
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- run: "! test -f world.txt"
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: my-artifact
|
||||||
|
|
||||||
|
- run: "test -f world.txt"
|
Loading…
Reference in a new issue