From 484336654a9b95f33d123f893dede2ea41c65905 Mon Sep 17 00:00:00 2001 From: codewithgun Date: Mon, 20 Jan 2025 21:07:03 +0800 Subject: [PATCH] chore: CI test --- .github/workflows/ci-pr-main.yml | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/ci-pr-main.yml diff --git a/.github/workflows/ci-pr-main.yml b/.github/workflows/ci-pr-main.yml new file mode 100644 index 0000000..89f539c --- /dev/null +++ b/.github/workflows/ci-pr-main.yml @@ -0,0 +1,35 @@ +name: CPI example + +on: + pull_request: + branches: + - main + +jobs: + program_changed_files: + runs-on: ubuntu-20.04 + outputs: + program: ${{steps.changed-files-specific.outputs.any_changed}} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Get specific changed files + id: changed-files-specific + uses: tj-actions/changed-files@v18.6 + with: + files: | + programs/cpi-example + + cpi_example_test: + runs-on: ubuntu-20.04 + needs: program_changed_files + if: needs.program_changed_files.outputs.program == 'true' + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: 1.76 + - uses: Swatinem/rust-cache@v2 + - run: cargo test -- --nocapture + shell: bash