From 141f72bf5cbf61cfa0bd29027b39482f0aaecebb Mon Sep 17 00:00:00 2001 From: Gaurav Aggarwal Date: Thu, 16 Mar 2023 06:31:50 +0000 Subject: [PATCH 1/3] Run kernel demos and unit tests for PR changes Kernel demos check builds multiple demos from FreeRTOS/FreeRTOS and unit tests check runs unit tests in FreeRTOS/FreeRTOS. Both of these checks currently use main branch of FreeRTOS-Kernel. This commits updates these checks to use the changes in the PR. Signed-off-by: Gaurav Aggarwal --- .github/workflows/kernel-demos.yml | 47 +++++++++++++++++++----------- .github/workflows/unit-tests.yml | 5 +++- 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/.github/workflows/kernel-demos.yml b/.github/workflows/kernel-demos.yml index d6eace575a..31e0f825e8 100644 --- a/.github/workflows/kernel-demos.yml +++ b/.github/workflows/kernel-demos.yml @@ -14,10 +14,12 @@ jobs: submodules: 'recursive' fetch-depth: 1 - - name: Fetch Kernel Submodule - shell: bash - run: | - git submodule update --checkout --init --depth 1 FreeRTOS/Source + # Checkout user pull request changes + - name: Checkout Pull Request + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + path: ./FreeRTOS/Source - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 @@ -42,10 +44,12 @@ jobs: submodules: 'recursive' fetch-depth: 1 - - name: Fetch Kernel Submodule - shell: bash - run: | - git submodule update --checkout --init --depth 1 FreeRTOS/Source + # Checkout user pull request changes + - name: Checkout Pull Request + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + path: ./FreeRTOS/Source - name: Build WIN32-MingW Demo working-directory: FreeRTOS/Demo/WIN32-MingW @@ -66,9 +70,12 @@ jobs: submodules: 'recursive' fetch-depth: 1 - - name: Fetch Kernel Submodule - shell: bash - run: git submodule update --checkout --init --depth 1 FreeRTOS/Source + # Checkout user pull request changes + - name: Checkout Pull Request + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + path: ./FreeRTOS/Source - name: Install GCC shell: bash @@ -93,9 +100,12 @@ jobs: submodules: 'recursive' fetch-depth: 1 - - name: Fetch Kernel Submodule - shell: bash - run: git submodule update --checkout --init --depth 1 FreeRTOS/Source + # Checkout user pull request changes + - name: Checkout Pull Request + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + path: ./FreeRTOS/Source - name: Install MSP430 Toolchain shell: bash @@ -120,9 +130,12 @@ jobs: submodules: 'recursive' fetch-depth: 1 - - name: Fetch Kernel Submodule - shell: bash - run: git submodule update --checkout --init --depth 1 FreeRTOS/Source + # Checkout user pull request changes + - name: Checkout Pull Request + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + path: ./FreeRTOS/Source - name: Install GNU ARM Toolchain shell: bash diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index a714b75725..b198c58b53 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -12,9 +12,12 @@ jobs: repository: FreeRTOS/FreeRTOS submodules: 'recursive' fetch-depth: 1 - - name: Clone This Repo + + # Checkout user pull request changes + - name: Checkout Pull Request uses: actions/checkout@v2 with: + ref: ${{ github.event.pull_request.head.sha }} path: ./FreeRTOS/Source - name: Setup Python From 2f7e96de58dd50d0baeca21d61cb396f7f71fd5b Mon Sep 17 00:00:00 2001 From: Gaurav Aggarwal Date: Thu, 16 Mar 2023 10:15:39 +0000 Subject: [PATCH 2/3] Do not specify PR SHA explicitly as that is default Signed-off-by: Gaurav Aggarwal --- .github/workflows/kernel-demos.yml | 5 ----- .github/workflows/unit-tests.yml | 1 - 2 files changed, 6 deletions(-) diff --git a/.github/workflows/kernel-demos.yml b/.github/workflows/kernel-demos.yml index 31e0f825e8..96a4c59759 100644 --- a/.github/workflows/kernel-demos.yml +++ b/.github/workflows/kernel-demos.yml @@ -18,7 +18,6 @@ jobs: - name: Checkout Pull Request uses: actions/checkout@v2 with: - ref: ${{ github.event.pull_request.head.sha }} path: ./FreeRTOS/Source - name: Add msbuild to PATH @@ -48,7 +47,6 @@ jobs: - name: Checkout Pull Request uses: actions/checkout@v2 with: - ref: ${{ github.event.pull_request.head.sha }} path: ./FreeRTOS/Source - name: Build WIN32-MingW Demo @@ -74,7 +72,6 @@ jobs: - name: Checkout Pull Request uses: actions/checkout@v2 with: - ref: ${{ github.event.pull_request.head.sha }} path: ./FreeRTOS/Source - name: Install GCC @@ -104,7 +101,6 @@ jobs: - name: Checkout Pull Request uses: actions/checkout@v2 with: - ref: ${{ github.event.pull_request.head.sha }} path: ./FreeRTOS/Source - name: Install MSP430 Toolchain @@ -134,7 +130,6 @@ jobs: - name: Checkout Pull Request uses: actions/checkout@v2 with: - ref: ${{ github.event.pull_request.head.sha }} path: ./FreeRTOS/Source - name: Install GNU ARM Toolchain diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index b198c58b53..73e1808fa2 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -17,7 +17,6 @@ jobs: - name: Checkout Pull Request uses: actions/checkout@v2 with: - ref: ${{ github.event.pull_request.head.sha }} path: ./FreeRTOS/Source - name: Setup Python From 99c4ddd7cad80ecc42c8a4643f8a00553b33fcc9 Mon Sep 17 00:00:00 2001 From: Gaurav Aggarwal Date: Thu, 16 Mar 2023 10:26:05 +0000 Subject: [PATCH 3/3] Remove explicit PR SHA from kernel checks Signed-off-by: Gaurav Aggarwal --- .github/workflows/kernel-checks.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/kernel-checks.yml b/.github/workflows/kernel-checks.yml index b295033d28..a4627f0e07 100644 --- a/.github/workflows/kernel-checks.yml +++ b/.github/workflows/kernel-checks.yml @@ -28,7 +28,6 @@ jobs: - name: Checkout Pull Request uses: actions/checkout@v2 with: - ref: ${{ github.event.pull_request.head.sha }} path: inspect # Collect all affected files