2022-10-31 21:00:24 +03:00
|
|
|
name: ci
|
2023-10-07 00:33:50 +03:00
|
|
|
run-name: "ci: ${{ github.event.pull_request.title }}"
|
2023-03-14 23:41:37 +03:00
|
|
|
|
2023-10-31 22:16:49 +03:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- projects/**/*
|
|
|
|
- .github/workflows/ci.yml
|
2022-10-31 21:00:24 +03:00
|
|
|
|
2023-10-07 00:33:50 +03:00
|
|
|
concurrency:
|
2023-12-13 13:42:25 +03:00
|
|
|
group: ci/${{ github.event.pull_request.head.ref }}
|
2023-10-07 00:33:50 +03:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-10-31 21:00:24 +03:00
|
|
|
jobs:
|
2023-12-15 21:32:55 +03:00
|
|
|
plan:
|
2022-10-31 21:00:24 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
2024-02-02 22:49:21 +03:00
|
|
|
matrix: ${{ steps.process-diff.outputs.matrix }}
|
2022-10-31 21:00:24 +03:00
|
|
|
steps:
|
2024-02-02 22:49:21 +03:00
|
|
|
- uses: pkgxdev/setup@v2
|
|
|
|
- uses: actions/checkout@v4
|
2022-10-31 21:00:24 +03:00
|
|
|
- uses: technote-space/get-diff-action@v6
|
2023-02-11 14:06:35 +03:00
|
|
|
id: get-diff
|
2022-10-31 21:00:24 +03:00
|
|
|
with:
|
|
|
|
PATTERNS: projects/**/package.yml
|
2024-02-02 22:49:21 +03:00
|
|
|
- name: process diff
|
|
|
|
id: process-diff
|
2024-02-03 00:01:49 +03:00
|
|
|
env:
|
|
|
|
PKGX_PANTRY_PATH: ${{ github.workspace }}
|
2023-02-11 14:06:35 +03:00
|
|
|
run: |
|
2024-02-02 22:49:21 +03:00
|
|
|
if [ -n "${{ steps.get-diff.outputs.diff }}" ]; then
|
|
|
|
for x in ${{ steps.get-diff.outputs.diff }}; do
|
|
|
|
y=$(echo $x | sed 's#projects/\(.*\)/[^/]*#\1#')
|
|
|
|
RESULT="$RESULT ${y//$'\n'/}"
|
|
|
|
done
|
2023-12-13 13:42:25 +03:00
|
|
|
else
|
2024-02-02 22:49:21 +03:00
|
|
|
RESULT="zlib.net kernel.org/linux-headers"
|
2023-12-13 13:42:25 +03:00
|
|
|
fi
|
2024-02-02 22:49:21 +03:00
|
|
|
|
|
|
|
./.github/scripts/get-ci-matrix.ts $RESULT
|
|
|
|
|
|
|
|
- run: echo '${{ steps.process-diff.outputs.matrix }}' | jq
|
2023-12-13 13:42:25 +03:00
|
|
|
|
2023-04-09 15:26:48 +03:00
|
|
|
build:
|
2023-12-15 21:32:55 +03:00
|
|
|
needs: plan
|
2023-02-04 03:52:04 +03:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-02-02 22:49:21 +03:00
|
|
|
include: ${{ fromJSON(needs.plan.outputs.matrix) }}
|
2023-12-13 13:42:25 +03:00
|
|
|
runs-on: ${{ matrix.platform.os }}
|
|
|
|
container: ${{ matrix.platform.container }}
|
2024-02-02 22:49:21 +03:00
|
|
|
name: ${{ matrix.pkg }} ${{ matrix.platform.tinyname }}
|
2023-12-15 21:32:55 +03:00
|
|
|
env:
|
|
|
|
PKGX_PANTRY_PATH: ${{ github.workspace }}
|
2023-12-13 13:42:25 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- uses: ./.github/actions/setup
|
|
|
|
with:
|
|
|
|
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE_P12 }}
|
|
|
|
p12-password: ${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }}
|
|
|
|
APPLE_IDENTITY: ${{ secrets.APPLE_IDENTITY }}
|
|
|
|
|
|
|
|
- uses: pkgxdev/setup@v2
|
|
|
|
with:
|
|
|
|
PKGX_DIR: /opt
|
|
|
|
|
2024-04-04 00:16:14 +03:00
|
|
|
- uses: pkgxdev/brewkit/build@4fdcda117b1c1067a9868136a9ee0b92ec704766 # TODO: revert to v1
|
2023-12-13 13:42:25 +03:00
|
|
|
id: build
|
|
|
|
with:
|
|
|
|
pkg: ${{ matrix.pkg }}
|
|
|
|
|
2024-04-04 00:16:14 +03:00
|
|
|
- uses: pkgxdev/brewkit/audit@4fdcda117b1c1067a9868136a9ee0b92ec704766 # TODO: revert to v1
|
2023-12-19 22:25:30 +03:00
|
|
|
with:
|
2023-12-22 21:04:52 +03:00
|
|
|
pkg: ${{ steps.build.outputs.pkgspec }}
|
2023-12-13 13:42:25 +03:00
|
|
|
|
2023-12-20 18:37:18 +03:00
|
|
|
# prevent tests passing because the build directory is still there
|
2024-02-02 22:49:21 +03:00
|
|
|
# requires `sudo` because `go` makes unremovable files…
|
2023-12-20 18:37:18 +03:00
|
|
|
- name: wipe builds directory
|
|
|
|
run: |
|
2024-02-02 22:49:21 +03:00
|
|
|
if command -v sudo >/dev/null; then
|
2024-02-01 22:58:29 +03:00
|
|
|
SUDO=sudo
|
|
|
|
fi
|
|
|
|
$SUDO rm -rf builds
|
2024-04-04 00:16:14 +03:00
|
|
|
|
|
|
|
- uses: pkgxdev/brewkit/test@4fdcda117b1c1067a9868136a9ee0b92ec704766 # TODO: revert to v1
|
2023-12-19 22:25:30 +03:00
|
|
|
with:
|
2023-12-22 21:04:52 +03:00
|
|
|
pkg: ${{ steps.build.outputs.pkgspec }}
|