Git Product home page Git Product logo

test-with-actions's Introduction

Test with Actions

Create workflows that enable you to use Continuous Integration (CI) for your projects.

Welcome

Continuous integration can help you stick to your team’s quality standards by running tests and reporting the results on GitHub. CI tools run builds and tests, triggered by commits. The results post back to GitHub in the pull request. The goal is fewer issues in main and faster feedback as you work.

  • Who is this for: Developers, DevOps Engineers, new GitHub users, students, teams.
  • What you'll learn: What continuous integration is, how to use GitHub Actions for CI, how to create a workflow that runs tests and produces test reports.
  • What you'll build: We'll use remark-lint to check the consistency of Markdown files.
  • Prerequisites: We assume you've completed Hello GitHub Actions first.
  • How long: This course takes less than two hours to complete.

In this course, you will:

  1. Add a test workflow
  2. Fix the test
  3. Upload a test report
  4. Add branch protections
  5. Merge your pull request

How to start this course

start-course

  1. Right-click Start course and open the link in a new tab.
  2. In the new tab, most of the prompts will automatically fill in for you.
    • For owner, choose your personal account or an organization to host the repository.
    • We recommend creating a public repository, as private repositories will use Actions minutes.
    • Scroll down and click the Create repository button at the bottom of the form.
  3. After your new repository is created, wait about 20 seconds, then refresh the page. Follow the step-by-step instructions in the new repository's README.

Get help: Post in our discussion boardReview the GitHub status page

© 2023 GitHub • Code of ConductMIT License

test-with-actions's People

Contributors

aaronscofield avatar cmwilson21 avatar dependabot[bot] avatar emilyistoofunky avatar ethanejones avatar heiskr avatar luispujols avatar malberda avatar osawata36 avatar parroty avatar sinsukehlab avatar weeyin83 avatar williamantonrohm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

test-with-actions's Issues

[Bug] Step 1.3 Search for "Simple workflow".

Describe the bug
Step 1.3 Search for "Simple workflow" isn't visible in the Actions tab until clicking New Workflow. This wasn't obvious (at least to me) and isn't mentioned in the write up.

To Reproduce
Steps to reproduce the behavior:

  1. Try to follow the steps described in Step 1

Expected behavior
Step 3 could read : Click new workflow and then search for "Simple workflow"

[Bug] Step 5 switch not work

Summary

The file "/.github/workflows/4-add-branch-protections.yml" is not working, the step switching part is commented

image

How to reproduce

Just create a branch protection and nothing will happen to switching automatically to the next step

[Bug] The `Run markdown lint` step in the `ci.yml` workflow raised multiple errors

Summary

The linting step in the learners' workflow raised unexpected errors.

How to reproduce

  1. Start the course.
  2. Follow Step 1.
  3. Create ci.yml. (Step was updated to 2 on the push to the ci branch.)
  4. Create pull request. (This triggered the ci.yml workflow.)
  5. See error.
    Run npm install remark-cli remark-preset-lint-consistent
      npm install remark-cli remark-preset-lint-consistent
      npx remark . --use remark-preset-lint-consistent --frail
      shell: /usr/bin/bash -e {0}
    
    added 320 packages in 6s
    
    136 packages are looking for funding
      run `npm fund` for details
    .github/steps/0-welcome.md: no issues found
    .github/steps/1-add-a-test-workflow.md
    24:32-24:38 warning Emphasis should use `_` as a marker                      emphasis-marker          remark-lint
    
    .github/steps/2-fix-the-test.md: no issues found
    .github/steps/3-upload-test-reports.md: no issues found
    .github/steps/4-add-branch-protections.md: no issues found
    .github/steps/5-merge-your-pull-request.md
    18:5        warning Don’t use mixed indentation for children, remove 1 space list-item-content-indent remark-lint
    
    .github/steps/X-finish.md: no issues found
    README.md: no issues found
    resume.md
    9:18-9:23   warning Emphasis should use `_` as a marker                      emphasis-marker          remark-lint
    
    ⚠ 3 warnings
    Error: Process completed with exit code 1.
    

Additional context

Made in #51 😬

Increment actions/upload-artifact version from 3 to 4 to avoid deprecation

Summary

As per this blog post, version 3 of the upload-artifact action will be deprecated on November 30th 2024. A change is needed to update the action version used from 3 to 4 to avoid being affected by the deprecation.

Changes

Update to use actions/upload-artifact@v4 instead of actions/upload-artifact@v3 in 3-upload-test-reports.md

Additional context

The following Annotations currently appear in the workflow summary when using upload-artifact@v3.

Screenshot 2024-04-19 at 2 12 52 PM

[Feature] TODO: figure out a better way to deal with the merge conflicts

Summary

ToDo of PR #53

Changes

Make a script to merge changes from origin/main into ci and run it before updating to Step 5 in the Step 4 workflow.

Additional context

An extract from the current Step 5 markdown

1. Go to the **Pull requests** tab.
1. Resolve any merge conflicts. <!-- TODO: figure out a better way to deal with the merge conflicts. -->
1. Click **Merge pull request**.

[Bug] `branch_protection_rule` trigger has an unexpected value

Summary

The branch_protection_rule trigger in 4-add-branch-protections.yml has an unexpected value branches (Ln 14).

How to reproduce

  1. Open this repository on VS Code.
  2. Enable the GitHub Actions extension.
  3. Open the PROBLEMS panel.
  4. See error.

Additional context

Add any other context about the problem here.

Step 3 - Uploading what artifact?

Summary

actions/upload-artifact does not know what artifact to upload in Step 3

How to reproduce

  1. Edit ci.yml as explained in Step 3: Upload test reports
  2. Run action
  3. Get Warning No files were found with the provided path: public/. No artifacts will be uploaded
    image

Additional context

This might be an error on my end, but the guide seems to be missing a step about how to upload the output of the markdown linter, as if actions/upload-artifact will automagically detect output from the previous step (which does not seem to be the case)

[Bug] Step 2 won't open in the `main` branch

Describe the bug
Step 2 won't open in the 'main' branch.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Step1
  2. Complete the Activity
  3. Refresh after ~20 seconds
  4. See error

Expected behavior
Step 2 opens both in the main and ci branch.

Screenshots
If applicable, add screenshots to help explain your problem.

Device information

  • Type: [e.g. iPhone6]
  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

[Bug] 2-fix-the-test.yml triggers on the wrong file.

Describe the bug
Completing "Step 2: Fix the test" doesn't result in the Step 3 being opened in the README.

This is because the 2-fix-the-test.yml workflow is looking for push on README.md however the test is failing because of a lint error in resume.md:

image

Was unable to complete step 2

Summary

I dont know GitHub actions (i was trying to learn) so I cannot tell you how to fix this, but...

How to reproduce

  1. I finished step 1 and added the CI file to the branch.
  2. Flow took me to step 2 "fix the test", but there is simply not enough information to the uninitiated to know what test its been talked about.
  3. There are simply not enough steps detail, i got lost, completely, gave up.

Additional context

And btw, the GitHub UI has changed significantly, the names of the buttons, the screenshots.... that doesnt help.

[Feature]

Summary

A clear and concise description of what the problem is, and what you solution you want.

Changes

What changes this feature would introduce. Any risks these changes involve. Any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

Skill is not working from step 2.

  1. When I add a simple workflow, and add the code from step 1, my workflow never fails.
  2. It shows all checks are passed, installs npm package and all. It never runs any tests.
  3. I am not able to move to the next step.

Screenshot 2023-02-21 at 1 28 56 PM

Improve Documentation please

As far as I can tell, the documentation for the test-with-actions lesson template is very out of date.

The steps from 8 - 10 cannot be followed. The language doesn't match what is actually seen on the screen. Not only that but no prompt is given to create a new branch or Create a pull request.

Perhaps I'm just misunderstanding the instructions but regardless, despite my best faith attempt at following the lesson, I cannot seem to make sense of the instructions as listed below.

  1. Click Start commit, and choose to make a new branch named ci.
  2. Click Propose a new file.
  3. Click Create pull request.

[Bug] Package name in the npm call in 1-add-a-test-workflow.md

Summary

Package name remark should be remark-cli instead

How to reproduce

  1. Go to 'https://github.com/skills/test-with-actions/blob/main/.github/steps/1-add-a-test-workflow.md'
  2. Click on '1-add-a-test-workflow.md'
  3. Scroll down to 'Activity: Add a test workflow'
  4. Go to "Step 7. Add the following step at the end of your workflow:"
  5. In the part that says "npx remark" it should be "npx remark-cli" instead.

Additional context

The student/learner will correct the "npx" to "npm" and the correct package name to invoke here is "remark-cli"

[Bug]"Require approvals" unchecking instruction required in Step 4.4 for consistency

Describe the bug
When following the current instruction of Step 4, learners are later forced to do
Merge without waiting for requirements to be met (bypass branch protections) in Step 5 to proceed
and this does not meet with the purpose of setting up branch protection (somewhat contradicting)

To Reproduce
Steps to reproduce the behavior:

  1. start the course of continuous-integration
  2. complete until Step 3
  3. in Step 4.4, check Require a pull request before merging as suggested in #8
  4. doing so will automatically insert check into Require approvals and set required number of approvals to 1 (Screenshot 1)
  5. since the learners are likely to have only him/herself in the learning repository, he/she cannot approve the pull request on the own in Step 5 and end up doing Merge without waiting for requirements to be met (bypass branch protections) to proceed (Screenshot 2)
  6. this does not make sense since learners are forced to bypass branch protection they just configured

Expected behavior
learners must be instructed to uncheck Require approvals in Step 4.4

Screenshots

  • Screenshot 1
    image
  • Screenshot 2
    image

Device information

  • in any environment

Additional context

  • None

[Bug] Step "Run markdown lint" ends with en error

Summary

Step "Run markdown lint" ends with en error and the README.md isn't updated

How to reproduce

  1. Open a new browser tab, and work on the steps in your second tab while you read the instructions in this tab

  2. Go to the Actions tab.

  3. Click New workflow.

  4. Search for "Simple workflow" and click Configure.

  5. Name your workflow ci.yml.

  6. Update the workflow to remove all steps other than the "checkout" step.

  7. Add the following step to your workflow:

    - name: Run markdown lint
      run: |
        npm install remark-cli remark-preset-lint-consistent
        npx remark . --use remark-preset-lint-consistent --frail

    Even after the code is indented properly in ci.yml, you will see a build error in GitHub Actions. We'll fix this in the next step.

  8. Click Start commit, and choose to make a new branch named ci.

  9. Click Propose a new file.

  10. Click Create pull request.

  11. Wait about 20 seconds then refresh this page (the one you're following instructions from). GitHub Actions will automatically update to the next step.

Image

[Bug] No errors generated in step 1 to be resolved in step 2

Summary

It is expected that in the first step, we will have an error generated to resolve, but mine does not generate any error. I appreciate any help!

How to reproduce

  1. Go to the Actions tab.
  2. Click New workflow.
  3. Search for "Simple workflow" and click Configure.
  4. Name your workflow ci.yml.
  5. Update the workflow by deleting the last two steps.
  6. Add the following step at the end of your workflow:
    - name: Run markdown lint
      run: |
        npm install remark-cli remark-preset-lint-consistent
        npx remark . --use remark-preset-lint-consistent --frail

My ci.yml:
image

No error when seeing the Actions tab.

[Bug] Step 4 workflow is not working

Summary

Workflow .github/workflows/4-add-branch-protections.yml is not working.

How to reproduce

  1. Create or edit branch protection setting
  2. Merge changes from origin main into ci step failure

image

Additional context

It's seem .github/script/merge-branch.sh has not executable permission.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.