From fee46cd3bd32d9af48a86e0cbedc23c432e8e369 Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Wed, 22 Nov 2023 21:14:33 +0800 Subject: [PATCH] WIP4 --- .github/workflows/ci.yaml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9193badb..118b01db 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,24 +7,33 @@ on: [ push, pull_request, workflow_dispatch ] jobs: test: + # https://docs.github.com/en/actions/learn-github-actions/expressions runs-on: ${{ fromJSON(matrix.os_deps).os }} timeout-minutes: 5 strategy: matrix: os_deps: - | - {"os": "ubuntu-latest"} + { "os": "ubuntu-latest" } - | - {"os": "macos-11"} + { "os": "macos-11" } - | - {"os": "macos-11", "deps": ["coreutils", "gnu-sed"]} + { + "os": "macos-11", + "deps": ["coreutils", "gnu-sed"], + "deps_desc": " + deps coreutils gnu-sed" + } - | - {"os": "macos-latest"} + { "os": "macos-latest" } - | - {"os": "macos-latest", "deps": ["coreutils", "gnu-sed"]} + { + "os": "macos-latest", + "deps": ["coreutils", "gnu-sed"], + "deps_desc": " + deps coreutils gnu-sed" + } fail-fast: false max-parallel: 64 - name: Test on ${{ matrix.os_deps }} + name: CI on ${{ fromJSON(matrix.os_deps).os }}${{ fromJSON(matrix.os_deps).deps_desc }} steps: - uses: actions/checkout@v3 @@ -32,9 +41,9 @@ jobs: submodules: recursive - run: brew list # https://docs.github.com/en/actions/learn-github-actions/variables#detecting-the-operating-system - # https://docs.github.com/en/actions/learn-github-actions/expressions if: runner.os == 'macOS' - # https://github.com/orgs/community/discussions/27125#discussioncomment-3254720 - run: brew install ${{ join(fromJSON(matrix.os_deps).deps, ' ') }} + # how to get object length? + # https://github.com/orgs/community/discussions/27125#discussioncomment-3254720 if: runner.os == 'macOS' && fromJSON(matrix.os_deps).deps[0] != null - run: test-cases/integration-test.sh