Skip to content

Commit

Permalink
feat: continuous integration
Browse files Browse the repository at this point in the history
  • Loading branch information
takeharak committed Apr 9, 2023
1 parent f96bb93 commit de9a16e
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: continuous-integration

on:
pull_request:
branches: [ main ]

jobs:
run-actions:
runs-on: ubuntu-latest
steps:
- name: Checkout base
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.base.ref }}

- name: checkout head
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup node env
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}
check-latest: true

- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install -g @textlint/textlint-plugin-markdown textlint textlint-rule-preset-ja-technical-writing textlint-rule-preset-ja-spacing

- name: textlint-github-pr-review
uses: tsuyoshicho/action-textlint@v3
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
fail_on_error: true
26 changes: 26 additions & 0 deletions .textlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"plugins": {
"@textlint/markdown": {
"extensions": [".md"]
}
},
"rules": {
"preset-ja-technical-writing": {
"no-exclamation-question-mark": {
"allowFullWidthExclamation": true,
"allowFullWidthQuestion": true
}
},
"preset-ja-spacing": {
"ja-space-between-half-and-full-width": {
"space": "always",
"exceptPunctuation": true
},
"ja-space-around-code": {
"before": true,
"after": true
}
},
"ja-technical-writing/sentence-length": false
}
}

0 comments on commit de9a16e

Please sign in to comment.