Skip to content

Commit

Permalink
chore: add ci lint test
Browse files Browse the repository at this point in the history
  • Loading branch information
tonai committed Nov 29, 2023
1 parent 8456c61 commit 3079cfb
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy to GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- 'main'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand All @@ -25,7 +23,6 @@ concurrency:
jobs:
# Build job
build:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# Simple workflow for building docusaurus
name: Build docusaurus

on:
# Runs on pushes targeting the default branch
# Runs on pull requests targeting the default branch
pull_request:
branches:
- 'main'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
# Build job
build:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Tests
on: push
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Lint
run: ${{ steps.detect-package-manager.outputs.manager }} run lint

0 comments on commit 3079cfb

Please sign in to comment.