-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (137 loc) · 4.75 KB
/
lint_format_test.yaml
File metadata and controls
137 lines (137 loc) · 4.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: lint_format_test
on:
workflow_dispatch:
pull_request:
paths-ignore:
- .github/**
- .husky/**
- '**/README.md'
branches:
- master
- beta
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.ACTIONS_PAT }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install
- name: Run lint-fix
run: npm run lint-fix
- name: Commit changes
id: commit
uses: EndBug/add-and-commit@v9
with:
commit: --no-verify
message: 'fix: resolve linter errors'
committer_name: GitHub Actions
outputs:
committed: ${{ steps.commit.outputs.committed }}
format:
needs: lint
if: needs.lint.outputs.committed == 'false'
name: format
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
token: ${{ secrets.ACTIONS_PAT }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install
- name: Run format
run: npm run format
- name: Commit changes
id: commit
uses: EndBug/add-and-commit@v9
with:
commit: --no-verify
message: 'fix: resolve formatting errors'
committer_name: GitHub Actions
committer_email: actions@github.com
outputs:
committed: ${{ steps.commit.outputs.committed }}
test:
needs: format
if: needs.format.outputs.committed == 'false'
name: test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
fail-fast: false
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Run test coverage and tests
run: npm run test-coverage:ci
env:
API_BASE_URL: ${{ vars.API_BASE_URL }}
SANDBOX_API_KEY: ${{ secrets.SANDBOX_API_KEY }}
TEST_APP_ID: ${{ vars.TEST_APP_ID }}
TEST_APP_IDS: ${{ vars.TEST_APP_IDS }}
TEST_APP_IDS_NO_ACCESS: ${{ vars.TEST_APP_IDS_NO_ACCESS }}
TEST_APP_ID_NO_ACCESS: ${{ vars.TEST_APP_ID_NO_ACCESS }}
TEST_ATTACHMENT: ${{ vars.TEST_ATTACHMENT }}
TEST_ATTACHMENT_FIELD: ${{ vars.TEST_ATTACHMENT_FIELD }}
TEST_ATTACHMENT_FIELD_NO_ACCESS_APP: ${{ vars.TEST_ATTACHMENT_FIELD_NO_ACCESS_APP }}
TEST_ATTACHMENT_FIELD_NO_ACCESS_FIELD: ${{ vars.TEST_ATTACHMENT_FIELD_NO_ACCESS_FIELD }}
TEST_FIELD_ID: ${{ vars.TEST_FIELD_ID }}
TEST_FIELD_IDS: ${{ vars.TEST_FIELD_IDS }}
TEST_FIELD_IDS_NO_ACCESS: ${{ vars.TEST_FIELD_IDS_NO_ACCESS }}
TEST_FIELD_ID_NO_ACCESS: ${{ vars.TEST_FIELD_ID_NO_ACCESS }}
TEST_IMAGE: ${{ vars.TEST_IMAGE }}
TEST_IMAGE_FIELD: ${{ vars.TEST_IMAGE_FIELD }}
TEST_LIST_FIELD: ${{ vars.TEST_LIST_FIELD }}
TEST_LIST_FIELD_NO_ACCESS: ${{ vars.TEST_LIST_FIELD_NO_ACCESS }}
TEST_LIST_ID: ${{ vars.TEST_LIST_ID }}
TEST_LIST_ID_NO_ACCESS: ${{ vars.TEST_LIST_ID_NO_ACCESS }}
TEST_LIST_ITEM_ID_NO_ACCESS: ${{ vars.TEST_LIST_ITEM_ID_NO_ACCESS }}
TEST_RECORD: ${{ vars.TEST_RECORD }}
TEST_REPORT: ${{ vars.TEST_REPORT }}
TEST_REPORT_NO_ACCESS: ${{ vars.TEST_REPORT_NO_ACCESS }}
TEST_REPORT_WITH_CHART_DATA: ${{ vars.TEST_REPORT_WITH_CHART_DATA }}
TEST_SURVEY_AUTO_NUMBER_FIELD: ${{ vars.TEST_SURVEY_AUTO_NUMBER_FIELD }}
TEST_SURVEY_ID: ${{ vars.TEST_SURVEY_ID }}
TEST_SURVEY_RECORD_ID: ${{ vars.TEST_SURVEY_RECORD_ID }}
TEST_TEXT_FIELD: ${{ vars.TEST_TEXT_FIELD }}
- name: Upload test coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.node-version }}
path: ./coverage
publish_test_coverage:
needs: test
name: publish_test_coverage
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Download test coverage artifact
uses: actions/download-artifact@v4.1.7
with:
name: coverage-20.x
path: ./coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}