From 1d2a12a0d01c2afd3f702f3de8d1e5a72027e04d Mon Sep 17 00:00:00 2001 From: lzy <3313948393@qq.com> Date: Tue, 3 Dec 2024 21:59:18 +0800 Subject: [PATCH] add workflow --- .github/workflows/15-matrices.yml | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/15-matrices.yml diff --git a/.github/workflows/15-matrices.yml b/.github/workflows/15-matrices.yml new file mode 100644 index 0000000..af6f7a9 --- /dev/null +++ b/.github/workflows/15-matrices.yml @@ -0,0 +1,60 @@ +# See 15-matrices/README.md for more information +# about how to leverage matrices within workflows. + +name: 15 - Working with Matrices + +on: + workflow_dispatch: + +jobs: + backwards-compatibility: + name: ${{ matrix.os }}-${{ matrix.node-version }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + node-version: [18.x, 20.x, 21.x] + os: + - ubuntu-latest + - windows-latest + include: + - os: ubuntu-latest + node-version: 16.x + - os: ubuntu-latest + node-version: 21.x + tag: experimental + steps: + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - name: Perform some tests + run: | + echo "Running tests on OS ${{ matrix.os }} and NodeJS ${{ matrix.node-version }}" + - name: Upload test results + run: echo "Uploading test results" + include-example: + name: ${{ matrix.color }}-${{ matrix.shape }}-${{ matrix.size }}-${{ matrix.opacity }} + runs-on: ubuntu-latest + strategy: + matrix: + color: [red, green] + shape: [circle, square] + size: [small, large] + include: + - color: red + opacity: 75 + - shape: circle + opacity: 100 + - color: red + shape: triangle + - opacity: 50 + - color: green + shape: circle + size: medium + exclude: + - color: green + shape: circle + steps: + - name: Dummy step + run: echo "${{ matrix.color }}-${{ matrix.shape }}-${{ matrix.size }}-${{ matrix.opacity }}" \ No newline at end of file