mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-23 23:03:34 +01:00
f82840f1ea
When the CI vars.ROLE is forgejo-coding, it is assumed to be the repository where collaborative coding happens, i.e. https://codeberg.org/forgejo/forgejo When the CI vars.ROLE is forgejo-testing, it is assumed that only codebase testing is to be run and no other tests such as release build integration, label constraints, backporting etc.
45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
# Copyright 2024 The Forgejo Authors
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
name: requirements
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- labeled
|
|
- edited
|
|
- opened
|
|
- synchronize
|
|
|
|
jobs:
|
|
merge-conditions:
|
|
if: vars.ROLE == 'forgejo-coding'
|
|
runs-on: docker
|
|
container:
|
|
image: 'code.forgejo.org/oci/node:20-bookworm'
|
|
steps:
|
|
- name: Debug output
|
|
run: |
|
|
cat <<'EOF'
|
|
${{ toJSON(github.event) }}
|
|
EOF
|
|
- name: Missing test label
|
|
if: >
|
|
!(
|
|
contains(toJSON(github.event.pull_request.labels), 'test/present')
|
|
|| contains(toJSON(github.event.pull_request.labels), 'test/not-needed')
|
|
|| contains(toJSON(github.event.pull_request.labels), 'test/manual')
|
|
)
|
|
run: |
|
|
echo "Test label must be set to either 'present', 'not-needed' or 'manual'."
|
|
exit 1
|
|
- name: Missing manual test instructions
|
|
if: >
|
|
(
|
|
contains(toJSON(github.event.pull_request.labels), 'test/manual')
|
|
&& !contains(toJSON(github.event.pull_request.body), '# Test')
|
|
)
|
|
run: |
|
|
echo "Manual test label is set. The PR description needs to contain test steps introduced by a heading like:"
|
|
echo "# Testing"
|
|
exit 1
|