Merge pull request #3 from gfurtadoalmeida/update-5.4 #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.4 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- 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 |