From 92840aebeb1cdf6c24a216f9370997efec5aaceb Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 20 Mar 2024 21:51:00 +0700 Subject: [PATCH 1/3] ci: rename workflows, jobs, and steps --- .github/workflows/{test.yml => test.yaml} | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) rename .github/workflows/{test.yml => test.yaml} (69%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yaml similarity index 69% rename from .github/workflows/test.yml rename to .github/workflows/test.yaml index 1f84ebb..6dd5d52 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yaml @@ -1,29 +1,30 @@ -name: test +name: Test on: workflow_dispatch: pull_request: push: branches: [main] jobs: - default-usage: + test-action: + name: Test Action runs-on: ${{ matrix.os }}-latest strategy: fail-fast: false matrix: os: [windows, ubuntu, macos] steps: - - name: Checkout the repository + - name: Checkout uses: actions/checkout@v4.1.2 - - name: Move the test project to the working directory + - name: Prepare Sample Project run: mv test/* . - - name: Configure and build the project + - name: Configure and Build Project uses: threeal/cmake-action@v1.3.0 with: run-build: true - - name: Use the action + - name: Test Project uses: ./ with: args: ${{ matrix.os == 'windows' && '-C Debug' || '' }} From 6ed2b28889efd6295bedff1f2fba7c598632df4d Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 20 Mar 2024 21:51:02 +0700 Subject: [PATCH 2/3] ci: checkout action to `ctest-action` directory --- .github/workflows/test.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6dd5d52..f1fb547 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,9 +15,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4.1.2 + with: + path: ctest-action - name: Prepare Sample Project - run: mv test/* . + run: mv ctest-action/test/* . - name: Configure and Build Project uses: threeal/cmake-action@v1.3.0 @@ -25,6 +27,6 @@ jobs: run-build: true - name: Test Project - uses: ./ + uses: ./ctest-action with: args: ${{ matrix.os == 'windows' && '-C Debug' || '' }} From c9a37ec53dcfb93a972ec7e153362eecf8a24357 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 20 Mar 2024 21:52:19 +0700 Subject: [PATCH 3/3] ci: checkout action sparsely --- .github/workflows/test.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f1fb547..413c98a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,6 +17,10 @@ jobs: uses: actions/checkout@v4.1.2 with: path: ctest-action + sparse-checkout: | + test + action.yaml + sparse-checkout-cone-mode: false - name: Prepare Sample Project run: mv ctest-action/test/* .