Skip to content

Commit

Permalink
Update course format for accessibility (#4)
Browse files Browse the repository at this point in the history
* Update course format for accessibility

* outline step files

* More automatic fixes

* Manual fixes

* manual fixes

* run prettier

* manual fixes

* manual fixes
  • Loading branch information
heiskr authored May 30, 2023
1 parent e7c2289 commit f441082
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 163 deletions.
File renamed without changes.
38 changes: 18 additions & 20 deletions .github/workflows/0-start.yml → .github/workflows/0-welcome.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
name: Step 0, Start
name: Step 0, Welcome

# This step triggers after the learner creates a new repository from the template
# This step sets STEP to 1
# This step closes <details id=0> and opens <details id=1>
# This step triggers after the learner creates a new repository from the template.
# This workflow updates from step 0 to step 1.

# This will run every time we create push a commit to `main`
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
# This will run every time we create push a commit to `main`.
# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
create:
workflow_dispatch:

# Reference https://docs.github.com/en/actions/security-guides/automatic-token-authentication
# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication
permissions:
# Need `contents: read` to checkout the repository
# Need `contents: write` to update the step metadata
# Need `contents: read` to checkout the repository.
# Need `contents: write` to update the step metadata.
contents: write

jobs:
Expand All @@ -24,34 +23,33 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- id: get_step
run: echo "::set-output name=current_step::$(cat ./.github/script/STEP)"
run: echo "::set-output name=current_step::$(cat ./.github/steps/-step.txt)"
outputs:
current_step: ${{ steps.get_step.outputs.current_step }}

on_start:
name: On start
needs: get_current_step

# We will only run this action when:
# 1. This repository isn't the template repository
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
# 1. This repository isn't the template repository.
# Reference: https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference: https://docs.github.com/en/actions/learn-github-actions/expressions
if: ${{ !github.event.repository.is_template && needs.get_current_step.outputs.current_step == 0}}

# We'll run Ubuntu for performance instead of Mac or Windows
# We'll run Ubuntu for performance instead of Mac or Windows.
runs-on: ubuntu-latest

steps:
# We'll need to check out the repository so that we can edit the README
# We'll need to check out the repository so that we can edit the README.
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # Let's get all the branches
fetch-depth: 0 # Let's get all the branches.

# Update README to close <details id=0> and open <details id=1>
# and set STEP to '1'
# In README.md, switch step 0 for step 1.
- name: Update to step 1
uses: skills/action-update-step@v1
uses: skills/action-update-step@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
from_step: 0
Expand Down
44 changes: 21 additions & 23 deletions .github/workflows/1-copilot-extension.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
name: Step 1, 1-Copilot Extension in a Codespace

# This step triggers after push to main#devcontainer.json
# This step sets STEP to 2
# This step closes <details id=1> and opens <details id=2>
# This step triggers after push to main#devcontainer.json.
# This workflow updates from step 1 to step 2.

# This will run every time we main#devcontainer.json
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
workflow_dispatch:
push:
paths:
- '.devcontainer/devcontainer.json'
- ".devcontainer/devcontainer.json"
branches:
- main

# Reference https://docs.github.com/en/actions/security-guides/automatic-token-authentication
# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication
permissions:
# Need `contents: read` to checkout the repository
# Need `contents: write` to update the step metadata
# Need `contents: read` to checkout the repository.
# Need `contents: write` to update the step metadata.
contents: write

jobs:
# The purpose of this job is to output the current step number
# (retreived from the STEP file). This output variable can
# then be referenced in other jobs and used in conditional
# The purpose of this job is to output the current step number
# (retreived from the step file). This output variable can
# then be referenced in other jobs and used in conditional.
# expressions.
get_current_step:
name: Check current step number
Expand All @@ -32,41 +31,40 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- id: get_step
run: echo "::set-output name=current_step::$(cat ./.github/script/STEP)"
run: echo "::set-output name=current_step::$(cat ./.github/steps/-step.txt)"
outputs:
current_step: ${{ steps.get_step.outputs.current_step }}

on_add_devcontainer:
name: On Add Devcontainer
needs: get_current_step

# We will only run this action when:
# 1. This repository isn't the template repository
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
# 1. This repository isn't the template repository.
# Reference: https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference: https://docs.github.com/en/actions/learn-github-actions/expressions
if: ${{ !github.event.repository.is_template && needs.get_current_step.outputs.current_step == 1 }}

# We'll run Ubuntu for performance instead of Mac or Windows
# We'll run Ubuntu for performance instead of Mac or Windows.
runs-on: ubuntu-latest

steps:
# We'll need to check out the repository so that we can edit the README
# We'll need to check out the repository so that we can edit the README.
- name: Checkout
uses: actions/checkout@v2

# Verify the learner added the file contents
# Verify the learner added the file contents.
- name: Check workflow contents, jobs
run: |
chmod a+x .github/script/check-file.sh
./.github/script/check-file.sh
env:
FILE: ".devcontainer/devcontainer.json"
SEARCH: "GitHub.copilot"

# Update README to close <details id=1> and open <details id=2>
# and set STEP to '2'

# In README.md, switch step 1 for step 2.
- name: Update to step 2
uses: skills/action-update-step@v1
uses: skills/action-update-step@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
from_step: 1
Expand Down
45 changes: 21 additions & 24 deletions .github/workflows/2-skills-javascript.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
name: Step 2, 2-Javascript function

# This step triggers after push to main#skills.js
# This step sets STEP to 3
# This step closes <details id=2> and opens <details id=3>
# This step triggers after push to main#skills.js.
# This workflow updates from step 2 to step 3.

# This will run every time we push to main#skills.js
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
# This will run every time we push to main#skills.js.
# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
workflow_dispatch:
push:
paths:
- 'skills.js'
- "skills.js"
branches:
- main

# Reference https://docs.github.com/en/actions/security-guides/automatic-token-authentication
# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication
permissions:
# Need `contents: read` to checkout the repository
# Need `contents: write` to update the step metadata
# Need `contents: read` to checkout the repository.
# Need `contents: write` to update the step metadata.
contents: write

jobs:
# The purpose of this job is to output the current step number
# (retreived from the STEP file). This output variable can
# then be referenced in other jobs and used in conditional
# The purpose of this job is to output the current step number
# (retreived from the step file). This output variable can
# then be referenced in other jobs and used in conditional
# expressions.
get_current_step:
name: Check current step number
Expand All @@ -32,29 +31,29 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- id: get_step
run: echo "::set-output name=current_step::$(cat ./.github/script/STEP)"
run: echo "::set-output name=current_step::$(cat ./.github/steps/-step.txt)"
outputs:
current_step: ${{ steps.get_step.outputs.current_step }}

on_functionadded:
name: On Creation of a Javascript function
needs: get_current_step

# We will only run this action when:
# 1. This repository isn't the template repository
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
# 1. This repository isn't the template repository.
# Reference: https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference: https://docs.github.com/en/actions/learn-github-actions/expressions
if: ${{ !github.event.repository.is_template && needs.get_current_step.outputs.current_step == 2 }}

# We'll run Ubuntu for performance instead of Mac or Windows
# We'll run Ubuntu for performance instead of Mac or Windows.
runs-on: ubuntu-latest

steps:
# We'll need to check out the repository so that we can edit the README
# We'll need to check out the repository so that we can edit the README.
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Let's get all the branches
fetch-depth: 0 # Let's get all the branches.

# Verify the PR updated package.json
- name: Check package.json
Expand All @@ -65,11 +64,9 @@ jobs:
FILE: "skills.js"
SEARCH: "function calculateNumbers"


# Update README to close <details id=2> and open <details id=3>
# and set STEP to '3'
# In README.md, switch step 2 for step 3.
- name: Update to step 3
uses: skills/action-update-step@v1
uses: skills/action-update-step@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
from_step: 2
Expand Down
49 changes: 23 additions & 26 deletions .github/workflows/3-copilot-hub.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
name: Step 3, 3-Copilot hub suggestion

# This step triggers after push to main#member.js
# This step sets STEP to 4
# This step closes <details id=3> and opens <details id=4>
# This step triggers after push to main#member.js.
# This workflow updates from step 3 to step 4.

# This will run every time we push to main#member.js
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
# This will run every time we push to main#member.js.
# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
workflow_dispatch:
push:
paths:
- 'member.js'
- "member.js"
branches:
- main

# Reference https://docs.github.com/en/actions/security-guides/automatic-token-authentication
# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication
permissions:
# Need `contents: read` to checkout the repository
# Need `contents: write` to update the step metadata
# Need `contents: read` to checkout the repository.
# Need `contents: write` to update the step metadata.
contents: write

jobs:
# The purpose of this job is to output the current step number
# (retreived from the STEP file). This output variable can
# then be referenced in other jobs and used in conditional
# The purpose of this job is to output the current step number
# (retreived from the step file). This output variable can
# then be referenced in other jobs and used in conditional
# expressions.
get_current_step:
name: Check current step number
Expand All @@ -32,44 +31,42 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- id: get_step
run: echo "::set-output name=current_step::$(cat ./.github/script/STEP)"
run: echo "::set-output name=current_step::$(cat ./.github/steps/-step.txt)"
outputs:
current_step: ${{ steps.get_step.outputs.current_step }}

on_Copilothubsuggestions:
name: On Copilot hub suggestion
needs: get_current_step

# We will only run this action when:
# 1. This repository isn't the template repository
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
# 1. This repository isn't the template repository.
# Reference: https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference: https://docs.github.com/en/actions/learn-github-actions/expressions
if: ${{ !github.event.repository.is_template && needs.get_current_step.outputs.current_step == 3 }}

# We'll run Ubuntu for performance instead of Mac or Windows
# We'll run Ubuntu for performance instead of Mac or Windows.
runs-on: ubuntu-latest

steps:
# We'll need to check out the repository so that we can edit the README
# We'll need to check out the repository so that we can edit the README.
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Let's get all the branches
fetch-depth: 0 # Let's get all the branches.

# Verify the skills member function is present
# Verify the skills member function is present.
- name: Check package for axios version 0.21.2
run: |
chmod a+x .github/script/check-file.sh
./.github/script/check-file.sh
env:
FILE: "member.js"
SEARCH: "skillsMember"


# Update README to close <details id=3> and open <details id=4>
# and set STEP to '4'

# In README.md, switch step 3 for step 4.
- name: Update to step 4
uses: skills/action-update-step@v1
uses: skills/action-update-step@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
from_step: 3
Expand Down
Loading

0 comments on commit f441082

Please sign in to comment.