Skip to content

Commit 34519d2

Browse files
authored
[IST-34] Update @actions/core, modernize Typescript (#25)
1 parent 9fe9434 commit 34519d2

16 files changed

+2639
-669
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/lib/**
2+
*.d.ts

.eslintrc.json

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"warnOnUnsupportedTypeScriptVersion": false,
5+
"ecmaVersion": 6,
6+
"sourceType": "module",
7+
"project": "tsconfig.json"
8+
},
9+
"env": {
10+
"browser": false,
11+
"node": true,
12+
"es6": true
13+
},
14+
"plugins": [
15+
"@typescript-eslint", "jsdoc", "no-null", "import"
16+
],
17+
"rules": {
18+
"@typescript-eslint/adjacent-overload-signatures": "error",
19+
"@typescript-eslint/array-type": ["error", { "default": "array" }],
20+
"@typescript-eslint/await-thenable": "error",
21+
22+
"camelcase": "off",
23+
"@typescript-eslint/camelcase": ["error", { "properties": "never", "allow": ["^[A-Za-z][a-zA-Za-z]+_[A-Za-z]+$"] }],
24+
25+
"@typescript-eslint/class-name-casing": "error",
26+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
27+
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as"}],
28+
"@typescript-eslint/explicit-function-return-type": ["error"],
29+
"@typescript-eslint/interface-name-prefix": "error",
30+
"@typescript-eslint/no-extra-parens": ["error", "all", {
31+
"returnAssign": false,
32+
"nestedBinaryExpressions": false,
33+
"enforceForArrowConditionals": false
34+
}],
35+
"@typescript-eslint/no-extra-semi": "error",
36+
"@typescript-eslint/no-floating-promises": "error",
37+
"@typescript-eslint/no-inferrable-types": "error",
38+
"@typescript-eslint/no-misused-new": "error",
39+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
40+
"@typescript-eslint/no-this-alias": "error",
41+
"@typescript-eslint/no-unnecessary-type-assertion": ["error", { "typesToIgnore": [] }],
42+
"@typescript-eslint/prefer-for-of": "error",
43+
"@typescript-eslint/prefer-function-type": "error",
44+
"@typescript-eslint/prefer-namespace-keyword": "error",
45+
"@typescript-eslint/prefer-optional-chain": "error",
46+
47+
"quotes": "off",
48+
"@typescript-eslint/quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
49+
50+
"@typescript-eslint/require-await": "error",
51+
52+
"semi": "off",
53+
"@typescript-eslint/semi": "error",
54+
55+
"@typescript-eslint/triple-slash-reference": "error",
56+
"@typescript-eslint/type-annotation-spacing": "error",
57+
"@typescript-eslint/unified-signatures": "error",
58+
59+
// eslint-plugin-import
60+
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],
61+
62+
// eslint-plugin-no-null
63+
"no-null/no-null": "error",
64+
65+
// eslint-plugin-jsdoc
66+
"jsdoc/check-alignment": "error",
67+
68+
// eslint
69+
"brace-style": ["error", "1tbs", { "allowSingleLine": false }],
70+
"constructor-super": "error",
71+
"curly": ["error", "all"],
72+
"dot-notation": "error",
73+
"eqeqeq": "error",
74+
"linebreak-style": ["error", "unix"],
75+
"new-parens": "error",
76+
"no-caller": "error",
77+
"no-duplicate-case": "error",
78+
"no-duplicate-imports": "error",
79+
"no-empty": "error",
80+
"no-eval": "error",
81+
"no-extra-bind": "error",
82+
"no-fallthrough": "error",
83+
"no-new-func": "error",
84+
"no-new-wrappers": "error",
85+
"no-return-await": "error",
86+
"no-restricted-globals": ["error",
87+
{ "name": "setTimeout" },
88+
{ "name": "clearTimeout" },
89+
{ "name": "setInterval" },
90+
{ "name": "clearInterval" },
91+
{ "name": "setImmediate" },
92+
{ "name": "clearImmediate" }
93+
],
94+
"no-sparse-arrays": "error",
95+
"no-template-curly-in-string": "error",
96+
"no-throw-literal": "error",
97+
"no-trailing-spaces": "error",
98+
"no-undef-init": "error",
99+
"no-unsafe-finally": "error",
100+
"no-unused-expressions": ["error", { "allowTernary": true }],
101+
"no-unused-labels": "error",
102+
"no-var": "error",
103+
"object-shorthand": "error",
104+
"prefer-const": "error",
105+
"prefer-object-spread": "error",
106+
"quote-props": ["error", "as-needed"],
107+
"space-in-parens": "error",
108+
"unicode-bom": ["error", "never"],
109+
"use-isnan": "error",
110+
111+
// prettier compatibility
112+
"@typescript-eslint/no-extra-parens": "off"
113+
}
114+
}
115+
116+

.github/workflows/push-workflow.yaml

+11-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,19 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@master
11+
1112
- name: Install dependencies
12-
run: npm install
13-
- name: Compile typescript
13+
run: npm ci
14+
15+
- name: Run checks
16+
run: npm run check
17+
18+
- name: Compile Typescript
1419
run: npm run build
20+
21+
- name: Run Tests
22+
run: npm test
23+
1524
- name: Run mabl tests against deployment
1625
id: mabl-test-deployment
1726
uses: ./

.prettierignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
package.json
22
node_modules
33
dist
4-
5-
*.yml
4+
bin

CONTRIBUTING.md

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ git commit -m "<version, e.g. v1.4> release"
1616

1717
# Tag the release
1818
git tag <version, e.g. v1.4>
19+
git push origin <version, e.g. v1.4>
1920
```
2021

2122
Once the tag exists, you make a new release from it in the github UI.
23+
24+
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.

README.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
name: mabl Test
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@master
20+
- uses: actions/checkout@v2
2121
2222
- name: Functional test deployment
2323
id: mabl-test-deployment
24-
uses: mablhq/github-run-tests-action@v1.4
24+
uses: mablhq/github-run-tests-action@v1
2525
env:
2626
MABL_API_KEY: ${{ secrets.MABL_API_KEY }}
2727
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -53,7 +53,7 @@ jobs:
5353
Use the
5454
[curl builder](https://app.mabl.com/workspaces/-/settings/apis#api-docs-selector-dropdown-button)
5555
to find the id.
56-
- `browser-types` {string} {optional}: comma seperated override for browser
56+
- `browser-types` {string} {optional}: comma separated override for browser
5757
types to test e.g. `chrome, firefox, safari, internet_explorer`. If not
5858
provided, mabl will test the browsers configured on the triggered test.
5959
- 'uri' {string} {optional} the base uri to test against. If provided, this will
@@ -83,3 +83,13 @@ jobs:
8383
deployment.
8484
- `tests_failed` {int32} - number of mabl tests that failed against this
8585
deployment.
86+
87+
88+
## Contributing
89+
90+
See [here](CONTRIBUTING.md) for details on contributing to this action.
91+
92+
## License
93+
94+
The Dockerfile and associated scripts and documentation in this project are
95+
released under the [MIT License](LICENSE).

0 commit comments

Comments
 (0)