File tree 12 files changed +3885
-21
lines changed
12 files changed +3885
-21
lines changed Original file line number Diff line number Diff line change
1
+ name : Pull Request
2
+ run-name : Pull Request for ${{ github.ref_name }} by ${{ github.actor }}
3
+
4
+ concurrency :
5
+ group : ${{ github.head_ref || github.run_id }}
6
+ cancel-in-progress : true
7
+
8
+ permissions : read-all
9
+
10
+ on :
11
+ pull_request : {}
12
+
13
+ jobs :
14
+ trunk_code_quality_runner :
15
+ name : Trunk Code Quality runner [linux]
16
+ runs-on : ubuntu-latest
17
+ permissions :
18
+ checks : write
19
+ contents : read
20
+
21
+ steps :
22
+ - uses : actions/checkout@v4
23
+
24
+ - name : Setup Node.js
25
+ uses : actions/setup-node@v4
26
+ with :
27
+ node-version : " 22"
28
+
29
+ - name : Install pnpm
30
+ uses : trunk-io/trunk-action/install@v1
31
+ with :
32
+ tools : pnpm
33
+
34
+ - name : Install dependencies
35
+ run : pnpm install
36
+
37
+ - name : Trunk Check
38
+ uses : trunk-io/trunk-action@v1
39
+
40
+ test_and_upload :
41
+ name : Test and Upload
42
+ runs-on : ubuntu-latest
43
+
44
+ steps :
45
+ - uses : actions/checkout@v4
46
+
47
+ - name : Setup Node.js
48
+ uses : actions/setup-node@v4
49
+ with :
50
+ node-version : " 22"
51
+
52
+ - name : Install pnpm
53
+ uses : trunk-io/trunk-action/install@v1
54
+ with :
55
+ tools : pnpm
56
+
57
+ - name : Run tests
58
+ shell : bash
59
+ run : |
60
+ pnpm install
61
+ pnpm test
62
+
63
+ # Do NOT continue-on-error for these uploads
64
+ - name : Trunk Analytics Uploader (Prod)
65
+ uses : ./
66
+ with :
67
+ junit-paths : junit.xml
68
+ org-slug : trunk
69
+ token : ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }}
70
+ allow-missing-junit-files : " false"
71
+ # Forces the uploader to not continue-on-error and use the CLI exit code
72
+ quarantine : " true"
73
+
74
+ - name : Trunk Analytics Uploader (Staging)
75
+ uses : ./
76
+ with :
77
+ junit-paths : junit.xml
78
+ org-slug : trunk-staging-org
79
+ token : ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }}
80
+ allow-missing-junit-files : " false"
81
+ # Forces the uploader to not continue-on-error and use the CLI exit code
82
+ quarantine : " true"
83
+ env :
84
+ TRUNK_PUBLIC_API_ADDRESS : https://api.trunk-staging.io
Original file line number Diff line number Diff line change
1
+ node_modules
2
+ junit.xml
Original file line number Diff line number Diff line change 6
6
plugins
7
7
user_trunk.yaml
8
8
user.yaml
9
+ tmp
Original file line number Diff line number Diff line change 2
2
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
3
3
version : 0.1
4
4
cli :
5
- version : 1.18.1
5
+ version : 1.22.8
6
6
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
7
7
plugins :
8
8
sources :
9
9
- id : trunk
10
- ref : v1.4.1
10
+ ref : v1.6.6
11
11
uri : https://github.com/trunk-io/plugins
12
12
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
13
13
runtimes :
14
14
enabled :
15
15
- go@1.21.0
16
- - node@18.12.1
16
+ - node@18.20.5
17
17
- python@3.10.8
18
18
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
19
19
lint :
20
20
enabled :
21
- - checkov@3.1.50
21
+ - actionlint@1.7.4
22
+ - checkov@3.2.334
23
+ - eslint@9.16.0
22
24
- git-diff-check
23
- - markdownlint@0.38.0
24
- - prettier@3.1.1
25
- - shellcheck@0.9.0
25
+ - markdownlint@0.43.0
26
+ - osv-scanner@1.9.1
27
+ - prettier@3.4.2
28
+ - shellcheck@0.10.0
26
29
- shfmt@3.6.0
27
- - trivy@0.48.1
28
- - trufflehog@3.63.7
29
- - yamllint@1.33.0
30
+ - sort-package-json@2.12.0
31
+ - trivy@0.58.0
32
+ - trufflehog@3.86.0
33
+ - trunk-toolbox@0.5.4
34
+ - yamllint@1.35.1
30
35
actions :
31
- disabled :
32
- - trunk-announce
36
+ definitions :
37
+ - id : test-pre-push
38
+ display_name : Arg Tests
39
+ runtime : node
40
+ packages_file : package.json
41
+ run : npm test
42
+ triggers :
43
+ - git_hooks : [pre-push]
33
44
enabled :
45
+ - test-pre-push
46
+ - trunk-announce
34
47
- trunk-check-pre-push
35
48
- trunk-fmt-pre-commit
36
49
- trunk-upgrade-available
50
+ tools :
51
+ enabled :
52
+ - pnpm@9.15.0
Original file line number Diff line number Diff line change 51
51
- name : Upload test results
52
52
run : ${GITHUB_ACTION_PATH}/script.sh ${{ inputs.run }}
53
53
shell : bash
54
- continue-on-error : ${{ inputs.run == '' && inputs.quarantine == '' }}
54
+ continue-on-error : ${{ inputs.run == '' && ( inputs.quarantine == '' || inputs.quarantine == 'false') }}
55
55
env :
56
56
JUNIT_PATHS : ${{ inputs.junit-paths }}
57
57
ORG_URL_SLUG : ${{ inputs.org-slug }}
Original file line number Diff line number Diff line change
1
+ import path from "node:path" ;
2
+ import url from "node:url" ;
3
+
4
+ import eslint from "@eslint/js" ;
5
+ import tseslint from "typescript-eslint" ;
6
+ import pluginJest from "eslint-plugin-jest" ;
7
+
8
+ export default tseslint . config (
9
+ eslint . configs . recommended ,
10
+ ...tseslint . configs . strictTypeChecked ,
11
+ ...tseslint . configs . stylisticTypeChecked ,
12
+ {
13
+ languageOptions : {
14
+ parserOptions : {
15
+ projectService : true ,
16
+ tsconfigRootDir : path . dirname ( url . fileURLToPath ( import . meta. url ) ) ,
17
+ } ,
18
+ } ,
19
+ } ,
20
+ {
21
+ rules : {
22
+ "no-console" : "error" ,
23
+ } ,
24
+ } ,
25
+ {
26
+ // update this to match your test files
27
+ files : [ "**/*.test.ts" ] ,
28
+ plugins : { jest : pluginJest } ,
29
+ languageOptions : {
30
+ globals : pluginJest . environments . globals . globals ,
31
+ } ,
32
+ rules : {
33
+ "jest/no-disabled-tests" : "warn" ,
34
+ "jest/no-focused-tests" : "error" ,
35
+ "jest/no-identical-title" : "error" ,
36
+ "jest/prefer-to-have-length" : "warn" ,
37
+ "jest/valid-expect" : "error" ,
38
+ } ,
39
+ } ,
40
+ ) ;
Original file line number Diff line number Diff line change
1
+ // eslint-disable-next-line no-undef
2
+ process . env . JEST_JUNIT_ADD_FILE_ATTRIBUTE = "true" ;
3
+
4
+ const config = {
5
+ preset : "ts-jest" ,
6
+ testEnvironment : "node" ,
7
+ extensionsToTreatAsEsm : [ ".ts" ] ,
8
+ moduleNameMapper : {
9
+ "^(\\.{1,2}/.*)\\.js$" : "$1" ,
10
+ } ,
11
+ reporters : [ "default" , "jest-junit" ] ,
12
+ transform : {
13
+ "^.+\\.ts?$" : [
14
+ "ts-jest" ,
15
+ {
16
+ useESM : true ,
17
+ } ,
18
+ ] ,
19
+ } ,
20
+ } ;
21
+
22
+ export default config ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " trunk-analytics-uploader" ,
3
+ "version" : " 0.1.0" ,
4
+ "private" : true ,
5
+ "type" : " module" ,
6
+ "scripts" : {
7
+ "test" : " NODE_OPTIONS=\" $NODE_OPTIONS --experimental-vm-modules\" jest"
8
+ },
9
+ "devDependencies" : {
10
+ "@eslint/js" : " ^9.16.0" ,
11
+ "@types/eslint__js" : " ^8.42.3" ,
12
+ "@types/jest" : " ^29.5.14" ,
13
+ "@types/node" : " ^22.7.9" ,
14
+ "eslint" : " ^9.16.0" ,
15
+ "eslint-plugin-jest" : " ^28.9.0" ,
16
+ "jest" : " ^29.7.0" ,
17
+ "jest-junit" : " ^16.0.0" ,
18
+ "ts-jest" : " ^29.2.5" ,
19
+ "ts-node" : " ^10.9.2" ,
20
+ "typescript" : " ^5.7.2" ,
21
+ "typescript-eslint" : " ^8.18.0"
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments