fixed workflow
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

This commit is contained in:
darkicewolf50 2025-04-03 22:56:23 -06:00 committed by GitHub
parent 7118958a77
commit 070680441b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,9 +3,8 @@
name: Test Gitea Actions
# events that will trigger this workflow.
# here, we only have "pull_request", so the workflow will run
# whenever we create a pull request.
# other examples: [push] and [pull_request, push]
# here, we only have "push", so the workflow will run
# whenever we push code to the repository.
on: [push]
env:
@ -17,111 +16,63 @@ env:
jobs:
# name of the job
first:
# the platform or OS that the workflow will run on.
runs-on: ubuntu-latest
# series of steps to finish the job.
steps:
# name of the step.
# steps run sequentially.
# this is optionale
- name: checkout
# each step can either have "uses" or "run".
# "uses" run an action written somewhere other than this workflow .
# usually from the community.
# this action checks out the repo code to the runner (instance)
# running the action
uses: actions/checkout@v3
# another step.
# this step runs a bash (Ubuntu's default shell) command
- name: list files
run: ls
# name of the job
check-code:
# the platform or OS that the workflow will run on.
runs-on: ubuntu-latest
# series of steps to finish the job.
steps:
# name of the step.
# steps run sequentially.
# this is optionale
- name: checkout
# each step can either have "uses" or "run".
# "uses" run an action written somewhere other than this workflow .
# usually from the community.
# this action checks out the repo code to the runner (instance)
# running the action
uses: actions/checkout@v4
- name: checkout
uses: actions/checkout@v4
- name: move to minigrep
run: cd minigrep/
# 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
# another step.
# Step 1: Run cargo check and fail if it fails
- name: Check
run: cargo check --verbose
- name: Check
run: |
cd minigrep/ # Make sure we're in the correct directory
cargo check --verbose
# name of the job
test:
# the platform or OS that the workflow will run on.
runs-on: ubuntu-latest
# Ensures this job runs only if check-code succeeds
needs: check-code
# series of steps to finish the job.
steps:
# name of the step.
# steps run sequentially.
# this is optionale
- name: checkout
# each step can either have "uses" or "run".
# "uses" run an action written somewhere other than this workflow .
# usually from the community.
# this action checks out the repo code to the runner (instance)
# running the action
uses: actions/checkout@v4
- name: checkout
uses: actions/checkout@v4
- name: move to minigrep
run: cd minigrep/
# Step 2: Run unit and integration tests (excluding documentation tests)
- name: Run Tests
run: cargo test --tests --verbose
- name: Run Tests
run: |
cd minigrep/
cargo test --tests --verbose
# name of the job
documentation-check:
# the platform or OS that the workflow will run on.
runs-on: ubuntu-latest
# Ensures this job runs only if check-code succeeds
needs: check-code
# series of steps to finish the job.
steps:
# name of the step.
# steps run sequentially.
# this is optionale
- name: checkout
# each step can either have "uses" or "run".
# "uses" run an action written somewhere other than this workflow .
# usually from the community.
# this action checks out the repo code to the runner (instance)
# running the action
uses: actions/checkout@v4
- name: checkout
uses: actions/checkout@v4
- name: move to minigrep
run: cd minigrep/
# Step 3: Check if documentation tests were run
- name: Check for Documentation Tests
run: |
DOC_TESTS=$(cargo test --doc --verbose)
if [[ ! "$DOC_TESTS" =~ "running" ]]; then
echo "No documentation tests were run!" && exit 1
fi
- 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