Skip to content

Commit

Permalink
[IST-34] Update @actions/core, modernize Typescript (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
twistedpair committed Oct 21, 2020
1 parent 9fe9434 commit 34519d2
Show file tree
Hide file tree
Showing 16 changed files with 2,639 additions and 669 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
@@ -0,0 +1,2 @@
/lib/**
*.d.ts
116 changes: 116 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,116 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"warnOnUnsupportedTypeScriptVersion": false,
"ecmaVersion": 6,
"sourceType": "module",
"project": "tsconfig.json"
},
"env": {
"browser": false,
"node": true,
"es6": true
},
"plugins": [
"@typescript-eslint", "jsdoc", "no-null", "import"
],
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": ["error", { "default": "array" }],
"@typescript-eslint/await-thenable": "error",

"camelcase": "off",
"@typescript-eslint/camelcase": ["error", { "properties": "never", "allow": ["^[A-Za-z][a-zA-Za-z]+_[A-Za-z]+$"] }],

"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as"}],
"@typescript-eslint/explicit-function-return-type": ["error"],
"@typescript-eslint/interface-name-prefix": "error",
"@typescript-eslint/no-extra-parens": ["error", "all", {
"returnAssign": false,
"nestedBinaryExpressions": false,
"enforceForArrowConditionals": false
}],
"@typescript-eslint/no-extra-semi": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/no-unnecessary-type-assertion": ["error", { "typesToIgnore": [] }],
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/prefer-optional-chain": "error",

"quotes": "off",
"@typescript-eslint/quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],

"@typescript-eslint/require-await": "error",

"semi": "off",
"@typescript-eslint/semi": "error",

"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",

// eslint-plugin-import
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],

// eslint-plugin-no-null
"no-null/no-null": "error",

// eslint-plugin-jsdoc
"jsdoc/check-alignment": "error",

// eslint
"brace-style": ["error", "1tbs", { "allowSingleLine": false }],
"constructor-super": "error",
"curly": ["error", "all"],
"dot-notation": "error",
"eqeqeq": "error",
"linebreak-style": ["error", "unix"],
"new-parens": "error",
"no-caller": "error",
"no-duplicate-case": "error",
"no-duplicate-imports": "error",
"no-empty": "error",
"no-eval": "error",
"no-extra-bind": "error",
"no-fallthrough": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-return-await": "error",
"no-restricted-globals": ["error",
{ "name": "setTimeout" },
{ "name": "clearTimeout" },
{ "name": "setInterval" },
{ "name": "clearInterval" },
{ "name": "setImmediate" },
{ "name": "clearImmediate" }
],
"no-sparse-arrays": "error",
"no-template-curly-in-string": "error",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-unsafe-finally": "error",
"no-unused-expressions": ["error", { "allowTernary": true }],
"no-unused-labels": "error",
"no-var": "error",
"object-shorthand": "error",
"prefer-const": "error",
"prefer-object-spread": "error",
"quote-props": ["error", "as-needed"],
"space-in-parens": "error",
"unicode-bom": ["error", "never"],
"use-isnan": "error",

// prettier compatibility
"@typescript-eslint/no-extra-parens": "off"
}
}


13 changes: 11 additions & 2 deletions .github/workflows/push-workflow.yaml
Expand Up @@ -8,10 +8,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Install dependencies
run: npm install
- name: Compile typescript
run: npm ci

- name: Run checks
run: npm run check

- name: Compile Typescript
run: npm run build

- name: Run Tests
run: npm test

- name: Run mabl tests against deployment
id: mabl-test-deployment
uses: ./
Expand Down
3 changes: 1 addition & 2 deletions .prettierignore
@@ -1,5 +1,4 @@
package.json
node_modules
dist

*.yml
bin
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -16,6 +16,9 @@ git commit -m "<version, e.g. v1.4> release"

# Tag the release
git tag <version, e.g. v1.4>
git push origin <version, e.g. v1.4>
```

Once the tag exists, you make a new release from it in the github UI.

Repeat the tagging process (no release needed) for the major version (e.g. `v1`) and delete/replace this tag, allowing users to peg against the major version in workflows and automatically get updates.
16 changes: 13 additions & 3 deletions README.md
Expand Up @@ -17,11 +17,11 @@ jobs:
name: mabl Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2
- name: Functional test deployment
id: mabl-test-deployment
uses: mablhq/github-run-tests-action@v1.4
uses: mablhq/github-run-tests-action@v1
env:
MABL_API_KEY: ${{ secrets.MABL_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
Use the
[curl builder](https://app.mabl.com/workspaces/-/settings/apis#api-docs-selector-dropdown-button)
to find the id.
- `browser-types` {string} {optional}: comma seperated override for browser
- `browser-types` {string} {optional}: comma separated override for browser
types to test e.g. `chrome, firefox, safari, internet_explorer`. If not
provided, mabl will test the browsers configured on the triggered test.
- 'uri' {string} {optional} the base uri to test against. If provided, this will
Expand Down Expand Up @@ -83,3 +83,13 @@ jobs:
deployment.
- `tests_failed` {int32} - number of mabl tests that failed against this
deployment.


## Contributing

See [here](CONTRIBUTING.md) for details on contributing to this action.

## License

The Dockerfile and associated scripts and documentation in this project are
released under the [MIT License](LICENSE).

0 comments on commit 34519d2

Please sign in to comment.