generated from gfurtadoalmeida/esp32-project-template
-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (65 loc) · 1.91 KB
/
development.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
name: development
on:
push:
branches: ["master"]
paths:
- 'components/**'
- 'main/**'
- 'test/**'
pull_request:
types:
- opened
- edited
- synchronize
- reopened
paths:
- 'components/**'
- 'main/**'
- 'test/**'
workflow_dispatch:
env:
ESP_DOCKER_IMAGE: gfurtadoalmeida/esp32-docker-sonar:v5.3
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v3
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_TOKEN}}
- name: Pull ESP-IDF Image
shell: pwsh
run: docker pull ${{env.ESP_DOCKER_IMAGE}}
- name: Build Push with Sonar
if: ${{github.event_name == 'push'}}
shell: pwsh
run: |
docker run `
--rm `
--env EDS_ORG=${{secrets.SONARCLOUD_ORGANIZATION}} `
--env EDS_TOKEN=${{secrets.SONARCLOUD_TOKEN}} `
--env EDS_BRANCH=${{github.ref_name}} `
--env LC_ALL='C.UTF-8' `
-v ${{github.workspace}}:/project `
-w /project ${{env.ESP_DOCKER_IMAGE}} `
idf.py build
- name: Build PR with Sonar
if: ${{github.event_name == 'pull_request'}}
shell: pwsh
run: |
docker run `
--rm `
--env EDS_ORG=${{secrets.SONARCLOUD_ORGANIZATION}} `
--env EDS_TOKEN=${{secrets.SONARCLOUD_TOKEN}} `
--env EDS_PR_KEY=${{github.event.pull_request.number}} `
--env EDS_PR_BRANCH=${{github.head_ref}} `
--env EDS_PR_BASE=${{github.base_ref}} `
--env LC_ALL='C.UTF-8' `
-v ${{github.workspace}}:/project `
-w /project ${{env.ESP_DOCKER_IMAGE}} `
idf.py build
- name: Build Test
shell: pwsh
run: docker run --rm --env LC_ALL='C.UTF-8' -v ${{github.workspace}}:/project -w /project ${{env.ESP_DOCKER_IMAGE}} idf.py -C ./test build