Skip to content

Commit

Permalink
Add CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Lefkowitz committed Apr 20, 2024
1 parent 0f3e8b7 commit 904fd13
Show file tree
Hide file tree
Showing 14 changed files with 5,995 additions and 4,096 deletions.
14 changes: 10 additions & 4 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
{
"language": "en",
"ignorePaths": [
".DS_Store",
".git",
".gitignore",
".husky",
".yarn",
"coverage",
"dist",
"docs/*.css",
"node_modules",
"yarn-error.log"
],
"dictionaries": [
"aws",
"bash",
"en-gb",
"fullstack",
"misc",
"node",
"softwareTerms",
"typescript"
"softwareTerms"
],
"words": [
"autofix",
"bumpversion",
"cliui",
"codacy",
"giphy",
"jsdoc",
"lefkowitz",
"superstruct"
"superstruct",
"trufflehog"
]
}
19 changes: 3 additions & 16 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,13 @@ runs:
using: composite
steps:
- name: Checkout the source code
uses: actions/checkout@v3

- name: Fetch yarn's cache directory path
id: yarn-cache-dir-path
shell: bash
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> $GITHUB_ENV

- name: Set up yarn package caching
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ env.YARN_CACHE_DIR }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
uses: actions/checkout@v4

- name: Set the node version
uses: actions/setup-node@v3
uses: actions/setup-node@v5
with:
node-version: ${{ inputs.node-version }}
cache: yarn

- name: Install node dependencies
shell: bash
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ on:
tags:
- "*.*.*"

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false
Expand All @@ -36,11 +31,15 @@ jobs:
path: "docs/dist"

deploy:
permissions:
pages: write
id-token: write

runs-on: ubuntu-latest
needs: build

environment:
name: github-pages
name: Pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/actions/install

- name: Build the package
run: npm run build

- uses: JS-DevTools/npm-publish@v1
- name: Publish the package
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/actions/install
Expand All @@ -22,4 +22,4 @@ jobs:
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./coverage/lcov.info
coverage-reports: coverage/clover.xml
30 changes: 3 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,30 +1,6 @@
.spago/
bower_components/
node_modules/
venv/

build/
.DS_Store
.yarn/
coverage/
dist/
generated-docs/
output/
tests_output/

__pycache__/
.mypy_cache/
.nx/
.pytest_cache/
.terraform/

*.coverage
*.dblite
*.egg-info/
*.env*
*.o
*.pyc
*.types

.DS_Store
.psc-ide-port
.terraform.lock.hcl
node_modules/
yarn-error.log
17 changes: 17 additions & 0 deletions .trufflehog3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
severity: low
exclude:
- message: Giphy links
pattern: media\.giphy\.com

- message: Shield links
pattern: img\.shields\.io

- message: Dependencies
paths:
- node_modules

- message: Tooling outputs
paths:
- package-lock.json
- yarn-error.log
- yarn.lock
32 changes: 32 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Start",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/ts-node",
"runtimeArgs": ["--transpile-only"],
"program": "${file}",
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"name": "Test",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
"args": [
"--verbose",
"-i",
"--no-cache",
"--testPathPattern",
"${fileBasename}"
],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
Empty file added docs/images/.gitkeep
Empty file.
File renamed without changes.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "reviewed",
"description": "Ergonomic, extensible and lightweight validators.",
"version": "0.9.1",
"private": false,
"license": "MIT",
"author": "Joel Lefkowitz",
"repository": "https://github.com/joellefkowitz/reviewed",
Expand All @@ -14,6 +13,7 @@
"keywords": [
"validation"
],
"packageManager": "[email protected]",
"metadata": {
"publisher": "npm",
"languages": [
Expand All @@ -26,8 +26,8 @@
"lifecycle": "Alpha"
},
"scripts": {
"prepare": "husky",
"lint": "cspell . --dot && eslint . --fix && tsc --noEmit",
"postinstall": "husky",
"lint": "cspell . --dot && eslint . --fix && tsc --noEmit && trufflehog3",
"format": "prettier . --write",
"build": "tsc",
"test": "jest",
Expand Down
2 changes: 1 addition & 1 deletion typedoc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"entryPoints": ["src"],
"out": "./docs/dist",
"customCss": "docs/typedoc.css",
"customCss": "docs/styles.css",
"cleanOutputDir": true,
"plugin": ["typedoc-material-theme"],
"themeColor": "#BA16B5",
Expand Down
Loading

0 comments on commit 904fd13

Please sign in to comment.