Skip to content

Commit

Permalink
test: add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zirkelc committed Jul 21, 2024
1 parent 24de936 commit af8c924
Show file tree
Hide file tree
Showing 17 changed files with 206 additions and 245 deletions.
25 changes: 25 additions & 0 deletions .github/actions/setup-and-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# https://github.com/vitest-dev/vitest/blob/main/.github/actions/setup-and-cache/action.yml
name: Setup Node.js and install dependencies
description: Setup PNPM and Node.js and install dependencies
inputs:
node-version:
required: false
description: Node version for setup-node
default: 20

runs:
using: composite

steps:
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'pnpm'

- name: Install dependencies
shell: bash
run: pnpm install
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
push:
branches:
- 'main'
pull_request:
workflow_dispatch:

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
permissions:
checks: write
contents: write
pull-requests: write
packages: read

jobs:
lint:
name: Lint
uses: ./.github/workflows/lint.yml

test:
name: Test
uses: ./.github/workflows/test.yml
secrets: inherit
19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Lint

on:
workflow_call:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4

- name: Setup Biome
uses: biomejs/setup-biome@v2

- name: Lint
run: biome ci --no-errors-on-unmatched .
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test

on:
workflow_call:

jobs:
test:
name: Unit
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4

- name: Setup and Install
id: install
uses: ./.github/actions/setup-and-install
with:
node-version: 20

- name: Start LocalStack
uses: LocalStack/[email protected]
with:
image-tag: 'latest'
install-awslocal: 'true'

- name: Test
run: pnpm test

- name: Coverage
if: ${{ steps.install.conclusion == 'success' }}
uses: davelosert/vitest-coverage-report-action@v2
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,5 @@ dist

# End of https://www.toptal.com/developers/gitignore/api/node

.DS_Store
.DS_Store
.turbo
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"files.associations": {
"turbo.js": "jsonc"
},
"typescript.tsdk": "node_modules/typescript/lib"
}
11 changes: 10 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,14 @@
"include": ["*.test.ts"],
"linter": {}
}
]
],
"json": {
"formatter": {
"enabled": true
},
"parser": {
"allowComments": true,
"allowTrailingCommas": true
}
}
}
Empty file.
116 changes: 0 additions & 116 deletions examples/stepfunctions_map/functions/single.ts

This file was deleted.

27 changes: 0 additions & 27 deletions examples/stepfunctions_map/package.json

This file was deleted.

82 changes: 0 additions & 82 deletions examples/stepfunctions_map/serverless.yml

This file was deleted.

4 changes: 0 additions & 4 deletions examples/stepfunctions_map/tsconfig.json

This file was deleted.

Loading

0 comments on commit af8c924

Please sign in to comment.