diff --git a/.gitea/workflows/testing.yaml b/.gitea/workflows/testing.yaml index 7d87d07..2991695 100644 --- a/.gitea/workflows/testing.yaml +++ b/.gitea/workflows/testing.yaml @@ -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: move to minigrep - run: cd minigrep/ - - # another step. - # Step 1: Run cargo check and fail if it fails - - name: Check - run: cargo check --verbose + 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: - - # 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: move to minigrep - run: cd minigrep/ - # Step 2: Run unit and integration tests (excluding documentation tests) - - name: Run Tests - run: cargo test --tests --verbose + 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: - - # 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. + needs: check-code + 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 \ No newline at end of file + - 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