Skip to content

Commit

Permalink
Migrate to TypeScript action
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed Jul 11, 2021
1 parent da0dbca commit 526ba48
Show file tree
Hide file tree
Showing 33 changed files with 75,327 additions and 160 deletions.
75 changes: 75 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"plugins": [
"jest",
"@typescript-eslint"
],
"extends": [
"plugin:github/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
"accessibility": "no-public"
}
],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error",
"camelcase": "off",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
],
"@typescript-eslint/func-call-spacing": [
"error",
"never"
],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"@typescript-eslint/semi": [
"error",
"always"
],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error"
},
"env": {
"node": true,
"es6": true,
"jest/globals": true
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/** -diff linguist-generated=true
56 changes: 0 additions & 56 deletions .github/workflows/depup.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ on:
- master
tags:
- 'v*.*.*'
pull_request:
types:
- labeled

jobs:
release:
if: github.event.action != 'labeled'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -45,3 +49,11 @@ jobs:
body: ${{ steps.bumpr.outputs.message }}
draft: false
prerelease: false

release-check:
if: github.event.action == 'labeled'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Post bumpr status comment
uses: haya14busa/action-bumpr@v1
23 changes: 23 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ jobs:
- name: golangci-lint
uses: ./
with:
go_version: "1"
cache: true
github_token: ${{ secrets.github_token }}
level: warning
golangci_lint_flags: "--config=.github/.golangci.yml ./testdata"

golangci-lint-platform:
name: runner / golangci-lint-platform
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
Expand All @@ -28,6 +31,8 @@ jobs:
- name: golangci-lint (platform)
uses: ./
with:
go_version: "1"
cache: true
github_token: ${{ secrets.github_token }}
tool_name: golangci-lint-${{ matrix.platform }}
level: warning
Expand All @@ -42,6 +47,8 @@ jobs:
- name: golangci-lint w/ github-pr-review
uses: ./
with:
go_version: "1"
cache: true
golangci_lint_flags: "./testdata"
tool_name: "golangci-lint-github-pr-review"
reporter: "github-pr-review"
Expand All @@ -55,6 +62,8 @@ jobs:
- name: golangci-lint w/ github-check
uses: ./
with:
go_version: "1"
cache: true
golangci_lint_flags: "./testdata"
tool_name: "golangci-lint-github-check"
level: warning
Expand All @@ -68,6 +77,8 @@ jobs:
- name: golangci-lint (workdir)
uses: ./
with:
go_version: "1"
cache: true
workdir: "./testdata"
golangci_lint_flags: ""
tool_name: "golangci-lint-workdir"
Expand All @@ -84,6 +95,8 @@ jobs:
- name: golangci-lint (All-In-One config)
uses: ./
with:
go_version: "1"
cache: true
github_token: ${{ secrets.github_token }}
tool_name: "golangci-lint-all-in-one"
level: warning
Expand All @@ -98,6 +111,8 @@ jobs:
- name: govet
uses: ./
with:
go_version: "1"
cache: true
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--disable-all -E govet ./testdata"
tool_name: govet
Expand All @@ -111,6 +126,8 @@ jobs:
- name: staticcheck
uses: ./
with:
go_version: "1"
cache: true
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--disable-all -E staticcheck ./testdata"
tool_name: staticcheck
Expand All @@ -124,6 +141,8 @@ jobs:
- name: golint
uses: ./
with:
go_version: "1"
cache: true
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--disable-all -E golint ./testdata"
tool_name: golint
Expand All @@ -138,6 +157,8 @@ jobs:
- name: errcheck
uses: ./
with:
go_version: "1"
cache: true
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--disable-all -E errcheck ./testdata"
tool_name: errcheck
Expand All @@ -152,6 +173,8 @@ jobs:
- name: misspell
uses: ./
with:
go_version: "1"
cache: true
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--disable-all -E misspell ./testdata"
tool_name: misspell
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: test
on:
pull_request:
push:

jobs:
test:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 12.x
cache: npm
- name: Install Dependencies
run: npm ci
- name: Run Test
run: npm run test
- name: Ensure dist/ folder is up-to-date
if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
npm run package
if [ "$(git diff --ignore-space-at-eol | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
Loading

0 comments on commit 526ba48

Please sign in to comment.