mirror of
https://github.com/ivabus/pantry
synced 2024-11-22 08:25:07 +03:00
ci tweaks (#4380)
This commit is contained in:
parent
9d6112bd9f
commit
641739b6ed
6 changed files with 47 additions and 40 deletions
4
.github/scripts/get-matrix.ts
vendored
4
.github/scripts/get-matrix.ts
vendored
|
@ -73,7 +73,7 @@ function get_matrix(platform: string) {
|
||||||
container: "debian:buster-slim",
|
container: "debian:buster-slim",
|
||||||
"test-os": [os],
|
"test-os": [os],
|
||||||
"test-container": ["debian:buster-slim", "ubuntu", "archlinux"],
|
"test-container": ["debian:buster-slim", "ubuntu", "archlinux"],
|
||||||
tinyname: "Lnx·x64"
|
tinyname: "*nix64"
|
||||||
}}
|
}}
|
||||||
case 'linux/aarch64': {
|
case 'linux/aarch64': {
|
||||||
const os = ["self-hosted", "linux", "ARM64"]
|
const os = ["self-hosted", "linux", "ARM64"]
|
||||||
|
@ -81,6 +81,6 @@ function get_matrix(platform: string) {
|
||||||
os, name,
|
os, name,
|
||||||
"test-os": [os],
|
"test-os": [os],
|
||||||
"test-container": [null],
|
"test-container": [null],
|
||||||
tinyname: "Lnx·ARM64"
|
tinyname: "*nix·ARM64"
|
||||||
}}}
|
}}}
|
||||||
}
|
}
|
||||||
|
|
8
.github/workflows/cd.yml
vendored
8
.github/workflows/cd.yml
vendored
|
@ -11,7 +11,7 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get-projects:
|
ingest:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
projects: ${{ steps.diff.outputs.diff }}
|
projects: ${{ steps.diff.outputs.diff }}
|
||||||
|
@ -29,13 +29,13 @@ jobs:
|
||||||
done
|
done
|
||||||
echo "diff=$RESULT" >> $GITHUB_OUTPUT
|
echo "diff=$RESULT" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
pkgit:
|
pkg:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
needs: get-projects
|
needs: ingest
|
||||||
permissions:
|
permissions:
|
||||||
issues: write
|
issues: write
|
||||||
uses: ./.github/workflows/new-version.yml
|
uses: ./.github/workflows/new-version.yml
|
||||||
with:
|
with:
|
||||||
projects: ${{ needs.get-projects.outputs.projects }}
|
projects: ${{ needs.ingest.outputs.projects }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
2
.github/workflows/ci-squared.yml
vendored
2
.github/workflows/ci-squared.yml
vendored
|
@ -22,6 +22,8 @@ jobs:
|
||||||
pkg:
|
pkg:
|
||||||
- r-wos.org/gti
|
- r-wos.org/gti
|
||||||
- github.com/ggerganov/llama.cpp # has platform restrictions
|
- github.com/ggerganov/llama.cpp # has platform restrictions
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
with:
|
with:
|
||||||
pkg: ${{ matrix.pkg }}
|
pkg: ${{ matrix.pkg }}
|
||||||
dry-run: true
|
dry-run: true
|
||||||
|
|
25
.github/workflows/new-version.yml
vendored
25
.github/workflows/new-version.yml
vendored
|
@ -16,7 +16,7 @@ on:
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
divide:
|
ingest:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
pkgs: ${{ steps.divide.outputs.pkgs }}
|
pkgs: ${{ steps.divide.outputs.pkgs }}
|
||||||
|
@ -26,26 +26,15 @@ jobs:
|
||||||
echo "pkgs=$var" >> $GITHUB_OUTPUT
|
echo "pkgs=$var" >> $GITHUB_OUTPUT
|
||||||
id: divide
|
id: divide
|
||||||
|
|
||||||
pkgit:
|
pkg:
|
||||||
needs: divide
|
needs: ingest
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
pkg: ${{ fromJSON(needs.divide.outputs.pkgs) }}
|
pkg: ${{ fromJSON(needs.ingest.outputs.pkgs) }}
|
||||||
uses: ./.github/workflows/pkg.yml
|
uses: ./.github/workflows/pkg.yml
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
with:
|
with:
|
||||||
pkg: ${{ matrix.pkg }}
|
pkg: ${{ matrix.pkg }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
complain:
|
|
||||||
needs: pkgit
|
|
||||||
if: failure()
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/complain
|
|
||||||
with:
|
|
||||||
pkg: ${{ inputs.projects }}
|
|
||||||
|
|
37
.github/workflows/pkg-platform.yml
vendored
37
.github/workflows/pkg-platform.yml
vendored
|
@ -5,20 +5,21 @@ on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
name:
|
name:
|
||||||
description: >
|
description: brewkit platform unique ID
|
||||||
pretty name for the workflow to make GitHub Actions matrix output
|
|
||||||
more legible
|
|
||||||
required: false
|
|
||||||
type: string
|
type: string
|
||||||
|
tinyname:
|
||||||
|
description: >
|
||||||
|
GitHub Actions has a non resizable sidebar so we need a shorter name
|
||||||
|
or it’s much harder to differentiate the different jobs.
|
||||||
|
type: string
|
||||||
|
default: ${{ inputs.name }}
|
||||||
os:
|
os:
|
||||||
required: true
|
|
||||||
type: string
|
type: string
|
||||||
container:
|
container:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
pkg:
|
pkg:
|
||||||
description: eg. `example.com@1.2.3`
|
description: eg. `example.com@1.2.3`
|
||||||
required: true
|
|
||||||
type: string
|
type: string
|
||||||
dry-run:
|
dry-run:
|
||||||
description: dry runs do not modify bottle storage
|
description: dry runs do not modify bottle storage
|
||||||
|
@ -26,14 +27,12 @@ on:
|
||||||
default: false
|
default: false
|
||||||
test-os:
|
test-os:
|
||||||
description: a JSON array of runner-names
|
description: a JSON array of runner-names
|
||||||
required: true
|
|
||||||
type: string
|
type: string
|
||||||
test-container:
|
test-container:
|
||||||
description: >
|
description: >
|
||||||
A JSON array of docker image names or `[null]`.
|
A JSON array of docker image names or `[null]`.
|
||||||
Indeed! You cannot leave this as `null` or undefined.
|
Indeed! You cannot leave this as `null` or undefined.
|
||||||
Sorry, GHA is not flexible enough to efficiently work around this.
|
Sorry, GHA is not flexible enough to efficiently work around this.
|
||||||
required: true
|
|
||||||
type: string
|
type: string
|
||||||
secrets:
|
secrets:
|
||||||
APPLE_CERTIFICATE_P12: { required: false }
|
APPLE_CERTIFICATE_P12: { required: false }
|
||||||
|
@ -48,7 +47,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: build (${{inputs.name}})
|
name: build ${{inputs.tinyname}}
|
||||||
runs-on: ${{ fromJSON(inputs.os) }}
|
runs-on: ${{ fromJSON(inputs.os) }}
|
||||||
container: ${{ inputs.container }}
|
container: ${{ inputs.container }}
|
||||||
outputs:
|
outputs:
|
||||||
|
@ -85,7 +84,7 @@ jobs:
|
||||||
- uses: pkgxdev/brewkit/upload-build-artifact@v1
|
- uses: pkgxdev/brewkit/upload-build-artifact@v1
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: test (${{inputs.name}}) ${{ matrix.container || ''}} ${{ join(matrix.os) }}
|
name: test ${{inputs.tinyname}} ${{ matrix.container || ''}} ${{ matrix.container || '' }} ${{ join(matrix.os, '+') }}
|
||||||
needs: build
|
needs: build
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -104,7 +103,7 @@ jobs:
|
||||||
pkg: ${{ needs.build.outputs.pkg }}
|
pkg: ${{ needs.build.outputs.pkg }}
|
||||||
|
|
||||||
bottle:
|
bottle:
|
||||||
name: bottle (${{inputs.name}}+${{matrix.compression}})
|
name: bottle (${{inputs.tinyname}}.${{matrix.compression}})
|
||||||
needs: [build, test]
|
needs: [build, test]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -168,7 +167,8 @@ jobs:
|
||||||
id: put
|
id: put
|
||||||
if: ${{ ! inputs.dry-run }}
|
if: ${{ ! inputs.dry-run }}
|
||||||
|
|
||||||
versions:
|
publish:
|
||||||
|
name: publish ${{inputs.tinyname}} ${{ inputs.dry-run && '(dry-run)' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [bottle, build]
|
needs: [bottle, build]
|
||||||
env:
|
env:
|
||||||
|
@ -208,3 +208,16 @@ jobs:
|
||||||
/$DIRNAME/versions.txt
|
/$DIRNAME/versions.txt
|
||||||
${{ needs.bottle.outputs.paths }}
|
${{ needs.bottle.outputs.paths }}
|
||||||
if: ${{ ! inputs.dry-run }}
|
if: ${{ ! inputs.dry-run }}
|
||||||
|
|
||||||
|
complain:
|
||||||
|
needs: [build, test, bottle]
|
||||||
|
if: failure() && !inputs.dry-run
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/complain
|
||||||
|
with:
|
||||||
|
pkg: ${{ inputs.pkg }}
|
||||||
|
platform: ${{ inputs.name }}
|
||||||
|
|
11
.github/workflows/pkg.yml
vendored
11
.github/workflows/pkg.yml
vendored
|
@ -12,7 +12,7 @@ on:
|
||||||
default: false
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get-matrix:
|
plan:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.matrix.outputs.matrix }}
|
matrix: ${{ steps.matrix.outputs.matrix }}
|
||||||
|
@ -22,14 +22,16 @@ jobs:
|
||||||
- run: .github/scripts/get-matrix.ts ${{ inputs.pkg }}
|
- run: .github/scripts/get-matrix.ts ${{ inputs.pkg }}
|
||||||
id: matrix
|
id: matrix
|
||||||
|
|
||||||
pkgit:
|
pkg:
|
||||||
needs: get-matrix
|
needs: plan
|
||||||
name: ${{matrix.platform.tinyname}}
|
name: ${{matrix.platform.tinyname}}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform: ${{ fromJSON(needs.get-matrix.outputs.matrix) }}
|
platform: ${{ fromJSON(needs.plan.outputs.matrix) }}
|
||||||
uses: ./.github/workflows/pkg-platform.yml
|
uses: ./.github/workflows/pkg-platform.yml
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
with:
|
with:
|
||||||
pkg: ${{ inputs.pkg }}
|
pkg: ${{ inputs.pkg }}
|
||||||
name: ${{ matrix.platform.name }}
|
name: ${{ matrix.platform.name }}
|
||||||
|
@ -38,4 +40,5 @@ jobs:
|
||||||
test-os: ${{ toJSON(matrix.platform.test-os) }}
|
test-os: ${{ toJSON(matrix.platform.test-os) }}
|
||||||
test-container: ${{ toJSON(matrix.platform.test-container) }}
|
test-container: ${{ toJSON(matrix.platform.test-container) }}
|
||||||
dry-run: ${{ inputs.dry-run }}
|
dry-run: ${{ inputs.dry-run }}
|
||||||
|
tinyname: ${{ matrix.platform.tinyname }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
Loading…
Reference in a new issue