55 lines
2.1 KiB
YAML
55 lines
2.1 KiB
YAML
name: Gitea Actions Demo
|
|
run-name: ${{ gitea.actor }} testing Actions
|
|
on: [push]
|
|
|
|
jobs:
|
|
Explore-Gitea-Actions:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
|
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
|
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
|
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
|
- name: List files in the repository
|
|
run: |
|
|
ls ${{ gitea.workspace }}
|
|
- run: echo "🍏 This job's status is ${{ job.status }}."
|
|
verify-artifact-upload:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 2
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: https://gitea.com/actions/checkout@v4
|
|
|
|
- name: Create Python environment
|
|
run: |
|
|
python3 -m venv .venv
|
|
|
|
- name: Diagnostic -- guarantee real content in test-results/
|
|
# Runs regardless of earlier step outcomes, so the upload step
|
|
# below always has something real to upload. Isolates whether
|
|
# gitea-upload-artifact itself works from whether the pytest step
|
|
# (or an earlier setup step) is what's actually failing.
|
|
if: always()
|
|
run: |
|
|
mkdir -p test-results
|
|
echo "diagnostic content $(date -u)" > test-results/diagnostic.txt
|
|
|
|
- name: Run the intentionally-failing verification test
|
|
run: |
|
|
.venv/bin/python -m pytest tests/test_zz_temp_verify_artifact_upload.py \
|
|
--tracing=retain-on-failure \
|
|
--screenshot=only-on-failure
|
|
|
|
- name: Upload failure artifacts
|
|
if: failure()
|
|
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
|
|
with:
|
|
name: test-results
|
|
path: test-results/
|
|
retention-days: 1
|