fixing github actions

This commit is contained in:
darkicewolf50 2025-04-02 16:16:03 -06:00
parent cd63c9fd53
commit 5ab5d5105e

View File

@ -1,6 +1,6 @@
# name of the workflow. # name of the workflow.
# this is optional. # this is optional.
name: Test Gitea Actions name: Test Rust Actions
# events that will trigger this workflow. # events that will trigger this workflow.
# here, we only have "push", so the workflow will run # here, we only have "push", so the workflow will run
@ -16,10 +16,8 @@ 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: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -31,54 +29,59 @@ jobs:
check-code: check-code:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# series of steps to finish the job.
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
# Step 1: Move to minigrep directory and run cargo check # Step 1: Move to minigrep directory and list files to debug
- name: move to minigrep - name: Move to minigrep and list files
run: cd minigrep/ run: |
cd minigrep/
ls -la # This will list the contents of the minigrep directory to ensure it's correct
- 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:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# Ensures this job runs only if check-code succeeds
needs: check-code needs: check-code
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
# Step 2: Move to minigrep directory and run cargo tests - name: Move to minigrep and list files
- name: move to minigrep run: |
run: cd minigrep/ cd minigrep/
ls -la # Debugging step to ensure we're in the right directory
- 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:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# Ensures this job runs only if check-code succeeds
needs: check-code needs: check-code
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
# Step 3: Move to minigrep directory - name: Move to minigrep and list files
- name: move to minigrep run: |
run: cd minigrep/ cd minigrep/
ls -la # Debugging step to ensure we're in the right directory
# Step 4: Check for Documentation Tests
- 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