From c391f16d6471af6b01674ec8d4c7779874d2495c Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sat, 9 Dec 2023 14:35:25 -0500 Subject: [PATCH] wip --- .github/scripts/get-matrix.ts | 24 ++++++++++-------------- .github/workflows/ci.yml | 4 ++-- .github/workflows/pkg.yml | 9 ++------- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/.github/scripts/get-matrix.ts b/.github/scripts/get-matrix.ts index 8b98ec4332..0787fea5ab 100755 --- a/.github/scripts/get-matrix.ts +++ b/.github/scripts/get-matrix.ts @@ -13,8 +13,8 @@ for (const platform of await get_platforms(project)) { const ghout = Deno.env.get("GITHUB_OUTPUT") if (ghout) { - const json = JSON.stringify({platform: Object.values(rv)}) - Deno.writeTextFileSync(ghout, `matrix=${json}`, { append: true }) + const json = JSON.stringify(Object.values(rv)) + Deno.writeTextFileSync(ghout, `matrix=${json}`, {append: true}) } else { const json = JSON.stringify(rv, null, 2) console.log(json) @@ -38,42 +38,38 @@ let { platforms } = await hooks.usePantry().project(pkg).yaml() } function get_matrix(platform: string) { + const name = platform.replace('/', '+') switch (platform) { case 'darwin/aarch64': { const os = ["self-hosted", "macOS", "ARM64"] return { - os, + os, name, "test-os": [os], "test-container": [null], - name: platform, tinyname: "²" }} case 'darwin/x86-64': { const os = ["self-hosted", "macOS", "X64"] return { - os, + os, name, "test-os": ["macos-11", "macos-12"], "test-container": [null], - name: platform, tinyname: "x64" }} case 'linux/x86-64': { const os = {group: "linux-x86-64"} return { - os, + os, name, "test-os": [os], "test-container": ["debian:buster-slim", "ubuntu", "archlinux"], - name: platform, - tinyname: "Linux x64" + tinyname: "Lx.x64" }} case 'linux/aarch64': { const os = ["self-hosted", "linux", "ARM64"] return { - os, + os, name, "test-os": [os], "test-container": [null], - name: platform, - tinyname: "Linux ARM64" - }} - } + tinyname: "Lx.ARM64" + }}} } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a822d587c7..e0f7316204 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,10 +44,10 @@ jobs: - os: ["self-hosted", "macOS", "ARM64"] name: ² - os: ["self-hosted", "linux", "ARM64"] - name: 🐧arm64 + name: Lx.ARM64 - os: {group: "linux-x86-64"} container: debian:buster-slim - name: 🐧x64 + name: Lx.x64 runs-on: ${{ matrix.platform.os }} container: ${{ matrix.platform.container }} steps: diff --git a/.github/workflows/pkg.yml b/.github/workflows/pkg.yml index 742f72280d..7753d5e847 100644 --- a/.github/workflows/pkg.yml +++ b/.github/workflows/pkg.yml @@ -22,18 +22,13 @@ jobs: - run: .github/scripts/get-matrix.ts ${{ inputs.pkg }} id: matrix - debug: - needs: get-matrix - runs-on: ubuntu-latest - steps: - - run: echo '${{needs.get-matrix.outputs.matrix}}' - pkgit: needs: get-matrix name: ${{matrix.platform.tinyname}} strategy: fail-fast: false - matrix: ${{ fromJSON(needs.get-matrix.outputs.matrix) }} + matrix: + platform: ${{ fromJSON(needs.get-matrix.outputs.matrix) }} uses: ./.github/workflows/pkg-for-platform.yml with: pkg: ${{ inputs.pkg }}