Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Dec 9, 2023
1 parent 06c54bf commit c391f16
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
24 changes: 10 additions & 14 deletions .github/scripts/get-matrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"
}}}
}
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit c391f16

Please sign in to comment.