-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (78 loc) · 2.24 KB
/
lint_tests_and_sonar.yml
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
name: Lint tests and sonar
on:
push:
branches:
- 'master'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 8.17
cache: 'npm'
- name: Run ci (install)
run: npm ci
- name: Run lint
run: npm run lint
login-erc:
uses: ./.github/workflows/login-ecr.yml
secrets:
AWS_PULL_ECR_ACCESS_KEY_ID: ${{ secrets.DOCKER_IMAGES_AWS_PULL_ACCESS_KEY_ID }}
AWS_PULL_ECR_SECRET_ACCESS_KEY: ${{ secrets.DOCKER_IMAGES_AWS_PULL_SECRET_ACCESS_KEY }}
test:
name: Test
runs-on: ubuntu-latest
needs: [login-erc]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Instalar Docker Compose Standalone
run: |
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: ${{ needs.login-erc.outputs.registry }}
username: ${{ needs.login-erc.outputs.docker_username }}
password: ${{ needs.login-erc.outputs.docker_password }}
- name: Run tests
run: make test-ci
- name: Upload Test Coverage
uses: actions/upload-artifact@v3
with:
name: superbowleto-coverage
path: |
coverage/
sonar:
name: Sonar
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download Coverage
uses: actions/download-artifact@v3
with:
name: superbowleto-coverage
path: |
coverage/
- name: Override Coverage Source Path for Sonar
run: |
sed -i 's/\/superbowleto\/src\//src\//g' coverage/lcov.info
- name: Run Sonar
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}