forked from Khan/perseus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/editor-updates
- Loading branch information
Showing
111 changed files
with
3,394 additions
and
2,146 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@khanacademy/perseus": minor | ||
--- | ||
|
||
Update Perseus' Storybook to use MathJax instead of KaTeX |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node | ||
{ | ||
"containerEnv": { "NODE_OPTIONS": "--openssl-legacy-provider" } | ||
"name": "Node.js & TypeScript", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/typescript-node:16", | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [6006], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "yarn install" | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: "Shared Node Cache" | ||
description: "Install & cache our npm dependencies" | ||
|
||
# The inputs this action expects. | ||
inputs: | ||
node-version: | ||
description: "Node version to use" | ||
required: true | ||
ssh-private-key: | ||
description: "A private SSH key so that we can obtain private dependencies like our event schema package" | ||
required: true | ||
|
||
# The steps this action runs. | ||
# The order of the two steps below needs to be maintained. | ||
# The ssh-agent step needs to be before the Node.js/Install step because our package.json uses | ||
# git+ssh. As this requires a valid SSH key, the ssh-agent action must be before the yarn install. | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ inputs.ssh-private-key }} | ||
|
||
- name: Use Node.js ${{ inputs.node-version }} & Install & cache node_modules | ||
uses: Khan/actions@shared-node-cache-v0 | ||
with: | ||
node-version: ${{ inputs.node-version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
name: Node CI | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
# edited is needed because that's the trigger when the base branch is | ||
# changed on a PR | ||
|
@@ -18,7 +19,7 @@ jobs: | |
node-version: [20.x] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
|
@@ -36,6 +37,10 @@ jobs: | |
matchAllGlobs: true # Default is to match any of the globs, which ends up matching all files | ||
conjunctive: true # Only match files that match all of the above | ||
|
||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.KHAN_ACTIONS_BOT_SSH_PRIVATE_KEY }} | ||
|
||
- name: Verify changeset entries | ||
uses: Khan/[email protected] | ||
with: | ||
|
@@ -50,12 +55,13 @@ jobs: | |
node-version: [20.x] | ||
steps: | ||
- name: Checking out latest commit | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} & Install & cache node_modules | ||
uses: Khan/actions@shared-node-cache-v0 | ||
- name: Install & cache node_modules | ||
uses: ./.github/actions/shared-node-cache | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
ssh-private-key: ${{ secrets.KHAN_ACTIONS_BOT_SSH_PRIVATE_KEY }} | ||
|
||
- name: Get All Changed Files | ||
uses: Khan/actions@get-changed-files-v1 | ||
|
@@ -128,26 +134,27 @@ jobs: | |
node-version: [20.x] | ||
steps: | ||
- name: Checking out latest commit | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} & Install & cache node_modules | ||
uses: Khan/actions@shared-node-cache-v0 | ||
- name: Install & cache node_modules | ||
uses: ./.github/actions/shared-node-cache | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
ssh-private-key: ${{ secrets.KHAN_ACTIONS_BOT_SSH_PRIVATE_KEY }} | ||
|
||
- name: Run test with coverage | ||
run: yarn cypress:ci | ||
|
||
# Upload coverage report as an GitHub artifact so that it can be used | ||
# later in upload_coverage. | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
- name: Upload Cypress Coverage | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cypress-coverage | ||
path: ./.nyc_output/out.json | ||
|
||
- name: Upload Cypress Screenshots | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: cypress-screenshots | ||
|
@@ -161,20 +168,21 @@ jobs: | |
os: [ubuntu-latest] | ||
node-version: [20.x] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} & Install & cache node_modules | ||
uses: Khan/actions@shared-node-cache-v0 | ||
- name: Install & cache node_modules | ||
uses: ./.github/actions/shared-node-cache | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
ssh-private-key: ${{ secrets.KHAN_ACTIONS_BOT_SSH_PRIVATE_KEY }} | ||
|
||
- name: Jest with coverage | ||
run: yarn coverage | ||
|
||
# Upload coverage report as an GitHub artifact so that it can be used | ||
# later in upload_coverage. | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
- name: Upload Jest Coverage | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: jest-coverage | ||
path: ./coverage/coverage-final.json | ||
|
@@ -184,23 +192,24 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: [cypress, coverage] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} & Install & cache node_modules | ||
uses: Khan/actions@shared-node-cache-v0 | ||
- name: Install & cache node_modules | ||
uses: ./.github/actions/shared-node-cache | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
ssh-private-key: ${{ secrets.KHAN_ACTIONS_BOT_SSH_PRIVATE_KEY }} | ||
|
||
- name: Download Jest Coverage | ||
uses: actions/download-artifact@v2 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: jest-coverage | ||
# path to decompress the artifact into, decompressed file | ||
# will be ./coverage-final.json | ||
path: ./ | ||
|
||
- name: Download Cypress Coverage | ||
uses: actions/download-artifact@v2 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: cypress-coverage | ||
# path to decompress the artifact into, decompressed file | ||
|
@@ -225,15 +234,16 @@ jobs: | |
node-version: [20.x] | ||
steps: | ||
- name: Checking out latest commit | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} & Install & cache node_modules | ||
uses: Khan/actions@shared-node-cache-v0 | ||
- name: Install & cache node_modules | ||
uses: ./.github/actions/shared-node-cache | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
ssh-private-key: ${{ secrets.KHAN_ACTIONS_BOT_SSH_PRIVATE_KEY }} | ||
# Make sure our packages aren't growing unexpectedly | ||
# This must come last as it builds the old code last and so leaves the | ||
# wrong code in place for the next job. | ||
# wrong code in place for the next job; in other words, it leaves the repo on a base branch. | ||
- name: Check Builds | ||
uses: preactjs/compressed-size-action@v2 | ||
with: | ||
|
@@ -246,6 +256,10 @@ jobs: | |
# Build production | ||
build-script: "build:prodsizecheck" | ||
|
||
# | ||
# Do not place any steps after "Check Builds" | ||
# | ||
|
||
extract_strings: | ||
name: Extract i18n strings | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -254,12 +268,13 @@ jobs: | |
os: [ubuntu-latest] | ||
node-version: [20.x] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} & Install & cache node_modules | ||
uses: Khan/actions@shared-node-cache-v0 | ||
- name: Install & cache node_modules | ||
uses: ./.github/actions/shared-node-cache | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
ssh-private-key: ${{ secrets.KHAN_ACTIONS_BOT_SSH_PRIVATE_KEY }} | ||
|
||
- name: Extract strings | ||
run: yarn extract-strings | ||
|
@@ -279,19 +294,20 @@ jobs: | |
steps: | ||
# We need to checkout all history, so that the changeseat tool can diff it | ||
- name: Checkout current commit | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: "0" | ||
- name: Ensure main branch is avaialble | ||
- name: Ensure main branch is available | ||
run: | | ||
REF=$(git rev-parse HEAD) | ||
git checkout main | ||
git checkout $REF | ||
- name: Use Node.js ${{ matrix.node-version }} & Install & cache node_modules | ||
uses: Khan/actions@shared-node-cache-v0 | ||
- name: Install & cache node_modules | ||
uses: ./.github/actions/shared-node-cache | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
ssh-private-key: ${{ secrets.KHAN_ACTIONS_BOT_SSH_PRIVATE_KEY }} | ||
|
||
- name: Publish Snapshot Release to npm | ||
id: publish-snapshot | ||
|
@@ -329,7 +345,7 @@ jobs: | |
body: | | ||
# npm Snapshot: Published | ||
🎉 Good news!! We've packaged up the latest commit from this PR (${{ | ||
Good news!! We've packaged up the latest commit from this PR (${{ | ||
steps.short-sha.outputs.short_sha }}) and published it to npm. You | ||
can install it using the tag `${{ | ||
steps.publish-snapshot.outputs.npm_snapshot_tag }}`. | ||
|
@@ -350,7 +366,7 @@ jobs: | |
body: | | ||
# npm Snapshot: **NOT** Published | ||
🤕 Oh noes!! We couldn't find any changesets in this PR (${{ | ||
Oh noes!! We couldn't find any changesets in this PR (${{ | ||
steps.short-sha.outputs.short_sha }}). As a result, we did not | ||
publish an npm snapshot for you. | ||
|
@@ -365,14 +381,15 @@ jobs: | |
# chromaui/@action doesn't work with shallow checkouts which is the | ||
# default for actions/checkout so we need to force it to checkout | ||
# more stuff. | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} & Install & cache node_modules | ||
uses: Khan/actions@shared-node-cache-v0 | ||
- name: Install & cache node_modules | ||
uses: ./.github/actions/shared-node-cache | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
ssh-private-key: ${{ secrets.KHAN_ACTIONS_BOT_SSH_PRIVATE_KEY }} | ||
|
||
- name: Publish to Chromatic | ||
uses: chromaui/action@v1 | ||
|
Oops, something went wrong.