RustBrock/.gitea/workflows/testing.yaml
darkicewolf50 070680441b
All checks were successful
Test Gitea Actions / first (push) Successful in 15s
Test Gitea Actions / check-code (push) Successful in 14s
Test Gitea Actions / test (push) Successful in 16s
Test Gitea Actions / documentation-check (push) Successful in 17s
fixed workflow
2025-04-03 22:56:23 -06:00

79 lines
1.8 KiB
YAML

# name of the workflow.
# this is optional.
name: Test Gitea Actions
# events that will trigger this workflow.
# here, we only have "push", so the workflow will run
# whenever we push code to the repository.
on: [push]
env:
CARGO_TERM_COLOR: always
# each workflow must have at least one job.
# jobs run in parallel by default (we can change that).
# each job groups together a series of steps to accomplish a purpose.
jobs:
# name of the job
first:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: list files
run: ls
# name of the job
check-code:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
# Step 1: Move to minigrep directory and list files to debug
# - name: Move to minigrep and list files
# run: |
# cd minigrep/
# ls -la # This will list the contents of the minigrep directory to ensure it's correct
- name: Check
run: |
cd minigrep/ # Make sure we're in the correct directory
cargo check --verbose
# name of the job
test:
runs-on: ubuntu-latest
needs: check-code
steps:
- name: checkout
uses: actions/checkout@v4
- name: Run Tests
run: |
cd minigrep/
cargo test --tests --verbose
# name of the job
documentation-check:
runs-on: ubuntu-latest
needs: check-code
steps:
- name: checkout
uses: actions/checkout@v4
- name: Check for Documentation Tests
run: |
cd minigrep/
DOC_TESTS=$(cargo test --doc --verbose)
if [[ ! "$DOC_TESTS" =~ "running" ]]; then
echo "No documentation tests were run!" && exit 1
fi