Woodpecker CI: Add test workflow
This commit is contained in:
parent
5213a827b6
commit
60b53a796c
1 changed files with 70 additions and 0 deletions
70
.woodpecker/test.yaml
Normal file
70
.woodpecker/test.yaml
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
when:
|
||||||
|
- event: pull_request
|
||||||
|
- event: push
|
||||||
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
- event: manual
|
||||||
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
labels:
|
||||||
|
platform: linux/amd64
|
||||||
|
memory: 'high'
|
||||||
|
|
||||||
|
variables:
|
||||||
|
artifacts_uploader_settings: &artifacts_uploader_settings
|
||||||
|
user:
|
||||||
|
from_secret: pleroma-ci-user
|
||||||
|
password:
|
||||||
|
from_secret: pleroma-ci-password
|
||||||
|
owner: 'pleroma'
|
||||||
|
package_name: 'pleroma-fe-test-artifacts'
|
||||||
|
script_file_entrypoint: &script_file_entrypoint
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- 'printf "%s" "$CI_SCRIPT" | base64 -d > /tmp/ci-script.sh && /bin/sh -xe /tmp/ci-script.sh'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
test:
|
||||||
|
image: mcr.microsoft.com/playwright:v1.57.0-jammy
|
||||||
|
environment:
|
||||||
|
APT_CACHE_DIR: apt-cache
|
||||||
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
FF_NETWORK_PER_BUILD: "true"
|
||||||
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
|
||||||
|
entrypoint: *script_file_entrypoint
|
||||||
|
commands:
|
||||||
|
- mkdir -pv $APT_CACHE_DIR && apt-get -qq update
|
||||||
|
- apt-get -y install zip
|
||||||
|
- yarn --frozen-lockfile
|
||||||
|
- |
|
||||||
|
if ! yarn unit-ci; then
|
||||||
|
zip -r ${CI_COMMIT_SHA:0:8}-screenshots.zip $(find . -type d -name __screenshots__)
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
upload-artifacts-pr:
|
||||||
|
image: &artifacts_uploader_image
|
||||||
|
docker.io/woodpeckercommunity/plugin-gitea-package:0.5.0
|
||||||
|
when:
|
||||||
|
- event: pull_request
|
||||||
|
status: [failure]
|
||||||
|
settings:
|
||||||
|
<<: *artifacts_uploader_settings
|
||||||
|
package_version: pr-${CI_COMMIT_PULL_REQUEST}
|
||||||
|
file_source: ./${CI_COMMIT_SHA:0:8}-screenshots.zip
|
||||||
|
file_name: pr-${CI_COMMIT_PULL_REQUEST}-screenshots.zip
|
||||||
|
update: true
|
||||||
|
|
||||||
|
upload-artifacts:
|
||||||
|
image: *artifacts_uploader_image
|
||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
status: [failure]
|
||||||
|
- event: manual
|
||||||
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
status: [failure]
|
||||||
|
settings:
|
||||||
|
<<: *artifacts_uploader_settings
|
||||||
|
package_version: ${CI_REPO_DEFAULT_BRANCH}-${CI_COMMIT_SHA:0:8}
|
||||||
|
file_source: ./${CI_COMMIT_SHA:0:8}-screenshots.zip
|
||||||
|
file_name: ${CI_COMMIT_SHA:0:8}-screenshots.zip
|
||||||
Loading…
Add table
Add a link
Reference in a new issue