pantry/.github/workflows/ci.yml

89 lines
2.4 KiB
YAML
Raw Normal View History

name: ci
run-name: "ci: ${{ github.event.pull_request.title }}"
2023-10-31 22:16:49 +03:00
on:
pull_request:
paths:
- projects/**/*
- .github/workflows/ci.yml
concurrency:
2023-12-13 13:42:25 +03:00
group: ci/${{ github.event.pull_request.head.ref }}
cancel-in-progress: true
jobs:
plan:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.process-diff.outputs.matrix }}
steps:
- uses: pkgxdev/setup@v2
- uses: actions/checkout@v4
- uses: technote-space/get-diff-action@v6
2023-02-11 14:06:35 +03:00
id: get-diff
with:
PATTERNS: projects/**/package.yml
- name: process diff
id: process-diff
env:
PKGX_PANTRY_PATH: ${{ github.workspace }}
2023-02-11 14:06:35 +03:00
run: |
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
RESULT="zlib.net kernel.org/linux-headers"
2023-12-13 13:42:25 +03:00
fi
./.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:
needs: plan
2023-02-04 03:52:04 +03:00
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.plan.outputs.matrix) }}
2023-12-13 13:42:25 +03:00
runs-on: ${{ matrix.platform.os }}
container: ${{ matrix.platform.container }}
name: ${{ matrix.pkg }} ${{ matrix.platform.tinyname }}
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:58:04 +03:00
- uses: pkgxdev/brewkit/build@v1
2023-12-13 13:42:25 +03:00
id: build
with:
pkg: ${{ matrix.pkg }}
2024-04-04 00:58:04 +03:00
- uses: pkgxdev/brewkit/audit@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
# requires `sudo` because `go` makes unremovable files…
2023-12-20 18:37:18 +03:00
- name: wipe builds directory
run: |
if command -v sudo >/dev/null; then
SUDO=sudo
fi
$SUDO rm -rf builds
2024-04-04 00:16:14 +03:00
2024-04-04 00:58:04 +03:00
- uses: pkgxdev/brewkit/test@v1
2023-12-19 22:25:30 +03:00
with:
2023-12-22 21:04:52 +03:00
pkg: ${{ steps.build.outputs.pkgspec }}