Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

86 changes: 0 additions & 86 deletions .eslintrc.json

This file was deleted.

105 changes: 54 additions & 51 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,23 @@ on: # rebuild any PRs and main branch changes
workflow_dispatch:
push:
branches:
- "main"
- 'main'

jobs:
jobs:
integration-tests:
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
env:
INTEGRATION_TEST_WORKFLOW_FILE: "integration-tests.yml"
INTEGRATION_TEST_WORKFLOW_FILE: 'integration-tests.yml'
INTEGRATION_TEST_WORKFLOW_ID: 64701969 # This ID Will Change On Fork
steps:
- uses: actions/checkout@v4
- id: nvmrc
name: Extract Node.JS Version
shell: bash
run: |
echo "node-version=$(cat .nvmrc)" >> "${GITHUB_OUTPUT}"
- name: Set Node.JS
uses: actions/setup-node@v4
with:
node-version: "${{ steps.nvmrc.outputs.node-version }}"
node-version-file: .node-version
- id: clean-dist
shell: bash
run: |
Expand All @@ -38,42 +33,48 @@ jobs:
npm run all
- uses: ./
id: fail-ref-workflow-dispatch
name: "Dispatch Workflow using workflow_dispatch Method, to a Non-existent Branch"
name:
'Dispatch Workflow using workflow_dispatch Method, to a Non-existent
Branch'
continue-on-error: true
with:
dispatch-method: "workflow_dispatch"
repo: "${{ github.event.repository.name }}"
owner: "${{ github.repository_owner }}"
ref: "non-existent-branch/${{ github.run_id }}" # This branch cannot realistically exist
workflow: "${{ env.INTEGRATION_TEST_WORKFLOW_FILE }}"
token: "${{ secrets.GITHUB_TOKEN }}"
dispatch-method: 'workflow_dispatch'
repo: '${{ github.event.repository.name }}'
owner: '${{ github.repository_owner }}'
ref: 'non-existent-branch/${{ github.run_id }}' # This branch cannot realistically exist
workflow: '${{ env.INTEGRATION_TEST_WORKFLOW_FILE }}'
token: '${{ secrets.GITHUB_TOKEN }}'
workflow-inputs: '{"placeholder": "placeholder"}'
- uses: ./
id: fail-file-workflow-dispatch
name: "Dispatch Workflow using workflow_dispatch Method, to a Non-existent Workflow File"
name:
'Dispatch Workflow using workflow_dispatch Method, to a Non-existent
Workflow File'
continue-on-error: true
with:
dispatch-method: "workflow_dispatch"
repo: "${{ github.event.repository.name }}"
owner: "${{ github.repository_owner }}"
ref: "main"
workflow: "${{ github.run_id }}.yml" # This workflow file cannot realistically exist
token: "${{ secrets.GITHUB_TOKEN }}"
dispatch-method: 'workflow_dispatch'
repo: '${{ github.event.repository.name }}'
owner: '${{ github.repository_owner }}'
ref: 'main'
workflow: '${{ github.run_id }}.yml' # This workflow file cannot realistically exist
token: '${{ secrets.GITHUB_TOKEN }}'
workflow-inputs: '{"placeholder": "placeholder"}'
- uses: ./
id: fail-inputs-workflow-dispatch
name: "Dispatch Workflow using workflow_dispatch Method, with an unsupported workflow inputs"
name:
'Dispatch Workflow using workflow_dispatch Method, with an unsupported
workflow inputs'
continue-on-error: true
with:
dispatch-method: "workflow_dispatch"
repo: "${{ github.event.repository.name }}"
owner: "${{ github.repository_owner }}"
ref: "main"
workflow: "${{ env.INTEGRATION_TEST_WORKFLOW_FILE }}"
token: "${{ secrets.GITHUB_TOKEN }}"
dispatch-method: 'workflow_dispatch'
repo: '${{ github.event.repository.name }}'
owner: '${{ github.repository_owner }}'
ref: 'main'
workflow: '${{ env.INTEGRATION_TEST_WORKFLOW_FILE }}'
token: '${{ secrets.GITHUB_TOKEN }}'
workflow-inputs: '{"placeholder": 0}' # 0 is not a string type
- id: verify-fail-workflow-dispatch
name: "Verify Action Outputs for worflow-dispatch"
name: 'Verify Action Outputs for worflow-dispatch'
shell: bash
run: |
set -euo pipefail
Expand All @@ -91,14 +92,14 @@ jobs:
fi
- uses: ./
id: workflow-dispatch
name: "Dispatch Using workflow_dispatch Method"
name: 'Dispatch Using workflow_dispatch Method'
with:
dispatch-method: "workflow_dispatch"
repo: "${{ github.event.repository.name }}"
owner: "${{ github.repository_owner }}"
ref: "refs/heads/main"
workflow: "${{ env.INTEGRATION_TEST_WORKFLOW_FILE }}"
token: "${{ secrets.GITHUB_TOKEN }}"
dispatch-method: 'workflow_dispatch'
repo: '${{ github.event.repository.name }}'
owner: '${{ github.repository_owner }}'
ref: 'refs/heads/main'
workflow: '${{ env.INTEGRATION_TEST_WORKFLOW_FILE }}'
token: '${{ secrets.GITHUB_TOKEN }}'
workflow-inputs: |
{
"string-type": "placeholder",
Expand All @@ -107,13 +108,15 @@ jobs:
}
- uses: ./
id: repository-dispatch-custom-backoff
name: "Dispatch Using repositroy_dispatch Method and custom exponential backoff parameters"
name:
'Dispatch Using repositroy_dispatch Method and custom exponential
backoff parameters'
with:
dispatch-method: "repository_dispatch"
event-type: "repository-dispatch"
repo: "${{ github.event.repository.name }}"
owner: "${{ github.repository_owner }}"
token: "${{ secrets.GITHUB_TOKEN }}"
dispatch-method: 'repository_dispatch'
event-type: 'repository-dispatch'
repo: '${{ github.event.repository.name }}'
owner: '${{ github.repository_owner }}'
token: '${{ secrets.GITHUB_TOKEN }}'
workflow-inputs: |
{
"string-type": "placeholder",
Expand All @@ -127,13 +130,13 @@ jobs:
time-multiple: 1.5
- uses: ./
id: wait-repository-dispatch
name: "Dispatch Using repository_dispatch Method And Wait For Run-ID"
name: 'Dispatch Using repository_dispatch Method And Wait For Run-ID'
with:
dispatch-method: "repository_dispatch"
event-type: "repository-dispatch"
repo: "${{ github.event.repository.name }}"
owner: "${{ github.repository_owner }}"
token: "${{ secrets.GITHUB_TOKEN }}"
dispatch-method: 'repository_dispatch'
event-type: 'repository-dispatch'
repo: '${{ github.event.repository.name }}'
owner: '${{ github.repository_owner }}'
token: '${{ secrets.GITHUB_TOKEN }}'
workflow-inputs: |
{
"string-type": "placeholder",
Expand All @@ -152,7 +155,7 @@ jobs:
owner: ${{ github.repository_owner }}
run_id: ${{ steps.wait-repository-dispatch.outputs.run-id }}
- id: verify-repository-dispatch-outputs
name: "Verify Action Outputs for repository-dispatch"
name: 'Verify Action Outputs for repository-dispatch'
shell: bash
run: |
set -euo pipefail
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# In TypeScript actions, `dist/` is a special directory. When you reference
# an action with the `uses:` property, `dist/index.js` is the code that will be
# run. For this project, the `dist/index.js` file is transpiled from other
# source files. This workflow ensures the `dist/` directory contains the
# expected transpiled code.
#
# If this workflow is run from a feature branch, it will act as an additional CI
# check and fail if the checked-in `dist/` directory does not match what is
# expected from the build.
name: Check Transpiled JavaScript

on:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read

jobs:
check-dist:
name: Check dist/
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v6

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm

- name: Remove dist/ Directory
id: remove-dist
run: npx rimraf ./dist

- name: Install Dependencies
id: install
run: npm ci

- name: Build dist/ Directory
id: build
run: npm run package

# This will fail the workflow if the `dist/` directory is different than
# expected.
- name: Compare Directories
id: diff
run: |
if [ ! -d dist/ ]; then
echo "Expected dist/ directory does not exist. See status below:"
ls -la ./
exit 1
fi
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff --ignore-space-at-eol --text dist/
exit 1
fi

# If `dist/` was different than expected, upload the expected version as a
# workflow artifact.
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
name: Upload Artifact
id: upload
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
Loading
Loading