mirror of
https://github.com/darkicewolf50/RustBrock.git
synced 2025-06-15 13:04:18 -06:00
fixed workflow
This commit is contained in:
parent
7118958a77
commit
070680441b
@ -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,111 +16,63 @@ 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.
|
- name: checkout
|
||||||
# steps run sequentially.
|
uses: actions/checkout@v4
|
||||||
# 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: 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.
|
- name: Check
|
||||||
# Step 1: Run cargo check and fail if it fails
|
run: |
|
||||||
- name: Check
|
cd minigrep/ # Make sure we're in the correct directory
|
||||||
run: cargo check --verbose
|
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.
|
- name: checkout
|
||||||
# steps run sequentially.
|
uses: actions/checkout@v4
|
||||||
# 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: move to minigrep
|
- name: Run Tests
|
||||||
run: cd minigrep/
|
run: |
|
||||||
|
cd minigrep/
|
||||||
# Step 2: Run unit and integration tests (excluding documentation tests)
|
cargo test --tests --verbose
|
||||||
- name: Run Tests
|
|
||||||
run: 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.
|
- name: checkout
|
||||||
# steps run sequentially.
|
uses: actions/checkout@v4
|
||||||
# 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: move to minigrep
|
- name: Check for Documentation Tests
|
||||||
run: cd minigrep/
|
run: |
|
||||||
|
cd minigrep/
|
||||||
# Step 3: Check if documentation tests were run
|
DOC_TESTS=$(cargo test --doc --verbose)
|
||||||
- name: Check for Documentation Tests
|
if [[ ! "$DOC_TESTS" =~ "running" ]]; then
|
||||||
run: |
|
echo "No documentation tests were run!" && exit 1
|
||||||
DOC_TESTS=$(cargo test --doc --verbose)
|
fi
|
||||||
if [[ ! "$DOC_TESTS" =~ "running" ]]; then
|
|
||||||
echo "No documentation tests were run!" && exit 1
|
|
||||||
fi
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user