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