From f46d36e842add61a9090fb34843b00e1acb25c22 Mon Sep 17 00:00:00 2001 From: Jason Teng Date: Sun, 20 Aug 2023 17:52:10 -0700 Subject: [PATCH 1/2] Add: skipping actions --- .github/workflows/build-all.yml | 32 +++++++++++++++++++++++++------- .vscode/tasks.json | 2 +- CMakeLists.txt | 2 +- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml index e62a70a..8bd2ab7 100644 --- a/.github/workflows/build-all.yml +++ b/.github/workflows/build-all.yml @@ -13,8 +13,18 @@ on: - '**.md' jobs: - github-build: + Skip_Checking: runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v5 + + Github-Build: + runs-on: ubuntu-latest + needs: Skip_Checking + if: needs.Skip_Checking.outputs.should_skip != 'true' steps: - name: Install Dependencies run: | @@ -36,8 +46,10 @@ jobs: - name: Build run: cmake --build $GITHUB_WORKSPACE/build -j 10 - alpine-build: + Alpine-Build: runs-on: ubuntu-latest + needs: Skip_Checking + if: needs.Skip_Checking.outputs.should_skip != 'true' container: image: "ghcr.io/jasonyang-ee/stm32-builder:alpine-latest" steps: @@ -45,8 +57,10 @@ jobs: - name: BUILD run: build.sh - arch-build: + Arch-Build: runs-on: ubuntu-latest + needs: Skip_Checking + if: needs.Skip_Checking.outputs.should_skip != 'true' container: image: "ghcr.io/jasonyang-ee/stm32-builder:arch-latest" steps: @@ -54,8 +68,10 @@ jobs: - name: BUILD run: build.sh - ubuntu-build-upload: + Ubuntu-Build-Upload: runs-on: ubuntu-latest + needs: Skip_Checking + if: needs.Skip_Checking.outputs.should_skip != 'true' container: image: "ghcr.io/jasonyang-ee/stm32-builder:ubuntu-latest" steps: @@ -76,16 +92,18 @@ jobs: path: ${{ github.workspace }}/build/*.bin Result: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest needs: - github-build - arch-build - alpine-build - ubuntu-build-upload + - Skip_Checking + if: always() && needs.Skip_Checking.outputs.should_skip != 'true' steps: - - name: All tests ok + - name: All Tests Ok if: ${{ !(contains(needs.*.result, 'failure')) }} run: exit 0 - - name: Some tests failed + - name: Some Tests Failed if: ${{ contains(needs.*.result, 'failure') }} run: exit 1 \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 8f53447..6f522ab 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -104,7 +104,7 @@ "serve", "--open", "--port", - "8000" + "8500" ], "options": { "cwd": "${workspaceFolder}" diff --git a/CMakeLists.txt b/CMakeLists.txt index d0ffa5d..50565ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.22) # Setup cmake module path and compiler settings list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") message("Build type: " ${CMAKE_BUILD_TYPE}) -set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD 17) set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_C_EXTENSIONS ON) set(CMAKE_CXX_STANDARD 17) From 1c6c05ee804473c405101260b4decdc5a69fd3b0 Mon Sep 17 00:00:00 2001 From: Jason Teng Date: Fri, 22 Dec 2023 10:02:47 -0800 Subject: [PATCH 2/2] Edit: removing -O flag and require cmake to set type --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 50565ff..b9a39c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,7 @@ set(EXECUTABLE ${CMAKE_PROJECT_NAME}) # USE .\getIncludeList.sh and .\getSourceList.sh to generate file list # Include List, Source List, and MCU Sepecific Setting +# Must Update these files in cmake/ when adding new source files include(STM32G431xx_HAL_PARA) include(SourceList) include(IncludeList) @@ -46,7 +47,6 @@ target_compile_options(${EXECUTABLE} PRIVATE -Wall -Wpedantic -Wno-unused-parameter - -Os # Optimize for size (that uses O2 ) ) # Linker options