Skip to content

Commit fcf36e2

Browse files
committed
add CIs
1 parent 91770ed commit fcf36e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+27570
-4
lines changed

.github/workflows/ci-e2e.yml renamed to .github/workflows/ci-dashboard-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: E2e testing
1+
name: Dashboard e2e testing
22

33
on:
44
workflow_dispatch:

.github/workflows/ci-unit.yml renamed to .github/workflows/ci-dashboard-unit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Unit testing
1+
name: Dashboard unit testing
22

33
on:
44
workflow_dispatch:

.github/workflows/ci-widget-e2e.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Widget e2e testing
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ $default-branch ]
7+
pull_request:
8+
branches: [ $default-branch ]
9+
10+
jobs:
11+
cypress:
12+
defaults:
13+
run:
14+
working-directory: widget
15+
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 15
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- run: npm install
23+
24+
- run: npm run build
25+
env:
26+
NODE_ENV: production
27+
28+
- name: Run project locally
29+
run: |
30+
npm install serve
31+
$(npm bin)/serve dist -s -p 8080 &
32+
33+
- name: Run tests
34+
uses: cypress-io/github-action@v2
35+
with:
36+
working-directory: widget
37+
browser: chrome
38+
headless: true

.github/workflows/ci-widget-unit.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Widget unit testing
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ $default-branch ]
7+
pull_request:
8+
branches: [ $default-branch ]
9+
10+
defaults:
11+
run:
12+
working-directory: widget
13+
14+
jobs:
15+
jest:
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
matrix:
20+
node-version: [13.x]
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v1
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
- run: npm install
29+
- run: npm run test:unit --if-present

dashboard/src/services/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const API_ENVS = {
1212
}
1313

1414
const httpClient = axios.create({
15-
baseURL: API_ENVS[process.env.NODE_ENV] ?? API_ENVS.local
15+
baseURL: API_ENVS[process.env.NODE_ENV] || API_ENVS.local
1616
})
1717

1818
httpClient.interceptors.request.use(config => {

dashboard/src/views/Credencials/index.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,14 @@
6767
class="py-3 pl-5 pr-20 mt-2 rounded bg-brand-gray w-full lg:w-2/3 overflow-x-scroll"
6868
>
6969
<span v-if="state.hasError">Erro ao carregar o script</span>
70-
<pre v-else>&lt;script src="https://igorhalfeld-feedbacker-widget.netlify.app?api_key={{store.User.currentUser.apiKey}}"&gt;&lt;/script&gt;</pre>
70+
<pre v-else>
71+
&lt;script
72+
defer
73+
async
74+
onload="init('{{store.User.currentUser.apiKey}}')"
75+
src="https://igorhalfeld-feedbacker-widget.netlify.app/init.js"
76+
&gt;&lt;/script&gt;
77+
</pre>
7178
</div>
7279
</div>
7380
</div>

widget/.browserslistrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> 1%
2+
last 2 versions
3+
not dead

widget/.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[*.{js,jsx,ts,tsx,vue}]
2+
indent_style = space
3+
indent_size = 2
4+
trim_trailing_whitespace = true
5+
insert_final_newline = true

widget/.eslintrc.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true
5+
},
6+
extends: [
7+
'plugin:vue/vue3-essential',
8+
'@vue/standard',
9+
'@vue/typescript/recommended'
10+
],
11+
parserOptions: {
12+
ecmaVersion: 2020
13+
},
14+
rules: {
15+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
16+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
17+
},
18+
overrides: [
19+
{
20+
files: [
21+
'**/*.{j,t}s?(x)',
22+
],
23+
env: {
24+
jest: true
25+
}
26+
}
27+
]
28+
}

widget/.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
/tests/e2e/videos/
6+
/tests/e2e/screenshots/
7+
8+
9+
# local env files
10+
.env.local
11+
.env.*.local
12+
13+
# Log files
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
pnpm-debug.log*
18+
19+
# Editor directories and files
20+
.idea
21+
.vscode
22+
*.suo
23+
*.ntvs*
24+
*.njsproj
25+
*.sln
26+
*.sw?

0 commit comments

Comments
 (0)