From 2c121874f2450e449360647079dd86290940d740 Mon Sep 17 00:00:00 2001 From: "github-classroom[bot]" <66690702+github-classroom[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:26:53 +0000 Subject: [PATCH 1/5] GitHub Classroom Autograding Workflow --- .github/workflows/classroom.yml | 64 +++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/classroom.yml diff --git a/.github/workflows/classroom.yml b/.github/workflows/classroom.yml new file mode 100644 index 0000000..162159b --- /dev/null +++ b/.github/workflows/classroom.yml @@ -0,0 +1,64 @@ +name: Autograding Tests +'on': +- workflow_dispatch +- repository_dispatch +permissions: + checks: write + actions: read + contents: read +jobs: + run-autograding-tests: + runs-on: ubuntu-latest + if: github.actor != 'github-classroom[bot]' + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Step 1 Create a Branch + id: step-1-create-a-branch + uses: classroom-resources/autograding-command-grader@v1 + with: + test-name: Step 1 Create a Branch + setup-command: sleep 20 + command: "[ $(cat .github/steps/-step.txt) -ge 1 ] || [ $(cat .github/steps/-step.txt) + = X ]" + timeout: 10 + max-score: 1 + - name: Step 2 Commit a File + id: step-2-commit-a-file + uses: classroom-resources/autograding-command-grader@v1 + with: + test-name: Step 2 Commit a File + setup-command: sleep 20 + command: "[ $(cat .github/steps/-step.txt) -ge 2 ] || [ $(cat .github/steps/-step.txt) + = X ]" + timeout: 10 + max-score: 1 + - name: Step 3 Open a Pull Request + id: step-3-open-a-pull-request + uses: classroom-resources/autograding-command-grader@v1 + with: + test-name: Step 3 Open a Pull Request + setup-command: sleep 20 + command: "[ $(cat .github/steps/-step.txt) -ge 3 ] || [ $(cat .github/steps/-step.txt) + = X ]" + timeout: 10 + max-score: 1 + - name: Step 4 Merge Your Pull Request + id: step-4-merge-your-pull-request + uses: classroom-resources/autograding-command-grader@v1 + with: + test-name: Step 4 Merge Your Pull Request + setup-command: sleep 20 + command: "[ $(cat .github/steps/-step.txt) -ge 4 ] || [ $(cat .github/steps/-step.txt) + = X ]" + timeout: 10 + max-score: 1 + - name: Autograding Reporter + uses: classroom-resources/autograding-grading-reporter@v1 + env: + STEP-1-CREATE-A-BRANCH_RESULTS: "${{steps.step-1-create-a-branch.outputs.result}}" + STEP-2-COMMIT-A-FILE_RESULTS: "${{steps.step-2-commit-a-file.outputs.result}}" + STEP-3-OPEN-A-PULL-REQUEST_RESULTS: "${{steps.step-3-open-a-pull-request.outputs.result}}" + STEP-4-MERGE-YOUR-PULL-REQUEST_RESULTS: "${{steps.step-4-merge-your-pull-request.outputs.result}}" + with: + runners: step-1-create-a-branch,step-2-commit-a-file,step-3-open-a-pull-request,step-4-merge-your-pull-request From adebab24cdfcbe226f7c21b0e7eeac27e914be4b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 2 Jul 2024 16:27:17 +0000 Subject: [PATCH 2/5] Update to 1 in STEP and README.md --- .github/steps/-step.txt | 2 +- README.md | 53 ++++++++++++++++++++++++++++------------- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/.github/steps/-step.txt b/.github/steps/-step.txt index 573541a..d00491f 100644 --- a/.github/steps/-step.txt +++ b/.github/steps/-step.txt @@ -1 +1 @@ -0 +1 diff --git a/README.md b/README.md index 9d971b5..b75dc21 100644 --- a/README.md +++ b/README.md @@ -14,29 +14,50 @@ _Get started using GitHub in less than an hour._ -## Welcome +## Step 1: Create a branch -People use GitHub to build some of the most advanced technologies in the world. Whether you’re visualizing data or building a new game, there’s a whole community and set of tools on GitHub that can help you do it even better. GitHub Skills’ “Introduction to GitHub” course guides you through everything you need to start contributing in less than an hour. +_Welcome to "Introduction to GitHub"! :wave:_ -- **Who is this for**: New developers, new GitHub users, and students. -- **What you'll learn**: We'll introduce repositories, branches, commits, and pull requests. -- **What you'll build**: We'll make a short Markdown file you can use as your [profile README](https://docs.github.com/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/managing-your-profile-readme). -- **Prerequisites**: None. This course is a great introduction for your first day on GitHub. -- **How long**: This course takes less than one hour to complete. +**What is GitHub?**: GitHub is a collaboration platform that uses _[Git](https://docs.github.com/get-started/quickstart/github-glossary#git)_ for versioning. GitHub is a popular place to share and contribute to [open-source](https://docs.github.com/get-started/quickstart/github-glossary#open-source) software. +
:tv: [Video: What is GitHub?](https://www.youtube.com/watch?v=pBy1zgt0XPc) -In this course, you will: +**What is a repository?**: A _[repository](https://docs.github.com/get-started/quickstart/github-glossary#repository)_ is a project containing files and folders. A repository tracks versions of files and folders. For more information, see "[About repositories](https://docs.github.com/en/repositories/creating-and-managing-repositories/about-repositories)" from GitHub Docs. -1. Create a branch -2. Commit a file -3. Open a pull request -4. Merge your pull request +**What is a branch?**: A _[branch](https://docs.github.com/en/get-started/quickstart/github-glossary#branch)_ is a parallel version of your repository. By default, your repository has one branch named `main` and it is considered to be the definitive branch. Creating additional branches allows you to copy the `main` branch of your repository and safely make any changes without disrupting the main project. Many people use branches to work on specific features without affecting any other parts of the project. -Wait about 20 seconds, then refresh the page. Follow the step-by-step instructions in this assignment repository's README. +Branches allow you to separate your work from the `main` branch. In other words, everyone's work is safe while you contribute. For more information, see "[About branches](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches)". + +**What is a profile README?**: A _[profile README](https://docs.github.com/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/managing-your-profile-readme)_ is essentially an "About me" section on your GitHub profile where you can share information about yourself with the community on GitHub.com. GitHub shows your profile README at the top of your profile page. For more information, see "[Managing your profile README](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/managing-your-profile-readme)". + +![profile-readme-example](/images/profile-readme-example.png) + +### :keyboard: Activity: Your first branch + +1. Open a new browser tab and navigate to your newly made repository. Then, work on the steps in your second tab while you read the instructions in this tab. +2. Navigate to the **< > Code** tab in the header menu of your repository. + + ![code-tab](/images/code-tab.png) + +3. Click on the **main** branch drop-down. + + ![main-branch-dropdown](/images/main-branch-dropdown.png) + +4. In the field, name your branch `my-first-branch`. In this case, the name must be `my-first-branch` to trigger the course workflow. +5. Click **Create branch: my-first-branch** to create your branch. + + ![create-branch-button](/images/create-branch-button.png) + + The branch will automatically switch to the one you have just created. + The **main** branch drop-down bar will reflect your new branch and display the new branch name. + +6. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step.