From 392359fc8c85be1a8752e9ab6b1ad9e45158b4a9 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 30 Dec 2022 00:03:31 -0700 Subject: [PATCH] chore: update the test (#909) --- .github/workflows/manual-matrix-test.yml | 69 ------------------------ .github/workflows/matrix-test.yml | 43 +++++++++++++++ 2 files changed, 43 insertions(+), 69 deletions(-) delete mode 100644 .github/workflows/manual-matrix-test.yml create mode 100644 .github/workflows/matrix-test.yml diff --git a/.github/workflows/manual-matrix-test.yml b/.github/workflows/manual-matrix-test.yml deleted file mode 100644 index e0a8e5f8..00000000 --- a/.github/workflows/manual-matrix-test.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Manual Matrix Test - -on: - workflow_dispatch: - pull_request: - branches: - - main - -jobs: - changed-files: - name: Get changes - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - matrix-raw-format: ${{ steps.set-matrix-json-raw-format.outputs.matrix }} - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 # needed for tj-actions/changed-files - - name: Get changed files - id: changed-files - uses: ./ - with: - json: true - - name: List all changed files - run: echo '${{ steps.changed-files.outputs.all_changed_files }}' - - id: set-matrix - run: echo "matrix={\"container\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT" - - name: Get changed files json raw format - id: changed-files-json-raw-format - uses: ./ - with: - json: true - json_raw_format: true - - name: List all changed files json raw format - run: echo '${{ steps.changed-files-json-raw-format.outputs.all_changed_files }}' - - id: set-matrix-json-raw-format - run: echo "matrix={\"container\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT" - - matrix-job: - name: Run Matrix Job - runs-on: ubuntu-latest - needs: [changed-files] - strategy: - matrix: ${{ fromJSON(needs.changed-files.outputs.matrix) }} - max-parallel: 4 - fail-fast: false - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Test - run: | - echo ${{ matrix.container }} - - matrix-job-json-raw-format: - name: Run Matrix Job json raw format - runs-on: ubuntu-latest - needs: [changed-files] - strategy: - matrix: ${{ fromJSON(needs.changed-files.outputs.matrix-raw-format) }} - max-parallel: 4 - fail-fast: false - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Test - run: | - echo ${{ matrix.container }} diff --git a/.github/workflows/matrix-test.yml b/.github/workflows/matrix-test.yml new file mode 100644 index 00000000..873a0593 --- /dev/null +++ b/.github/workflows/matrix-test.yml @@ -0,0 +1,43 @@ +name: Matrix Test + +on: + workflow_dispatch: + pull_request: + branches: + - main + +jobs: + changed-files: + name: Get changes + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Get changed files + id: changed-files + uses: ./ + with: + json: true + - name: List all changed files + run: echo '${{ steps.changed-files.outputs.all_changed_files }}' + - id: set-matrix + run: echo "matrix={\"container\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT" + + matrix-job: + name: Run Matrix Job + runs-on: ubuntu-latest + needs: [changed-files] + strategy: + matrix: ${{ fromJSON(needs.changed-files.outputs.matrix) }} + max-parallel: 4 + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Test + run: | + echo ${{ matrix.container }}