Skip to content

Commit

Permalink
Add linter and docs generation
Browse files Browse the repository at this point in the history
  • Loading branch information
piranna committed Sep 16, 2023
1 parent 151c63d commit b0f8141
Show file tree
Hide file tree
Showing 5 changed files with 6,735 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@mafalda-sfu"
}
64 changes: 64 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI
# test, build documentation and publish

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
publish:
permissions:
contents: read
packages: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
registry-url: https://npm.pkg.github.com
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- run: npm ci --verbose
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npm install --verbose @mafalda-sfu/test-reporter-json
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: |
NODE_OPTIONS='--test-reporter=spec --test-reporter-destination=stdout --test-reporter=@mafalda-sfu/test-reporter-json --test-reporter-destination=coverage.json' \
npm test
- run: npm run docs

- uses: cpina/[email protected]
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
destination-github-username: Mafalda-SFU
destination-repository-name: Mafalda-SFU.github.io
source-directory: docs
target-directory: docs/${{ github.event.repository.name }}
user-email: [email protected]
user-name: Mafalda bot

- name: "Combine"
run: |
export TOTAL=$(cat coverage.json | jq .summary.totals.coveredLinePercent)
echo "total=$TOTAL" >> $GITHUB_ENV
echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY
- name: Dynamic Badges
uses: Schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
filename: ${{ github.event.repository.name }}.json
gistID: 27d772a9a3a8a945b34fd9676de40486
label: Coverage
minColorRange: 50
message: ${{ env.total }}%
maxColorRange: 90
namedLogo: Jest
valColorRange: ${{ env.total }}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm test
Loading

0 comments on commit b0f8141

Please sign in to comment.