pantry/.github/workflows/ci.yml

94 lines
2.6 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:
2023-12-13 13:42:25 +03:00
pkgs: ${{ steps.diff.outputs.pkgs }}
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
2023-02-11 14:06:35 +03:00
id: get-diff
with:
PATTERNS: projects/**/package.yml
2023-02-11 14:06:35 +03:00
- id: diff
run: |
2022-12-31 17:50:18 +03:00
for x in ${{ steps.get-diff.outputs.diff }}; do
2023-12-13 13:42:25 +03:00
y=$(echo $x | sed 's#projects/\(.*\)/[^/]*#\1#')
2023-12-16 00:30:22 +03:00
RESULT="$RESULT ${y//$'\n'/}"
2022-12-31 17:50:18 +03:00
done
2023-12-13 13:42:25 +03:00
if [ -n "$RESULT" ]; then
RESULT="$(echo -n $RESULT | jq -R -s -c 'split(" ")')"
2023-12-13 13:42:25 +03:00
else
RESULT='["zlib.net"]'
fi
echo "pkgs=$RESULT" >> $GITHUB_OUTPUT
2023-04-09 15:26:48 +03:00
build:
if: needs.plan.outputs.pkgs
needs: plan
2023-12-13 13:42:25 +03:00
name: ci ${{ matrix.platform.name }} ${{matrix.pkg}}
2023-02-04 03:52:04 +03:00
strategy:
fail-fast: false
matrix:
pkg: ${{ fromJSON(needs.plan.outputs.pkgs) }}
2023-02-04 03:52:04 +03:00
platform:
2023-12-13 13:42:25 +03:00
- os: ["self-hosted", "macOS", "X64"]
name: x64
- os: ["self-hosted", "macOS", "ARM64"]
name: ²
- os: ["self-hosted", "linux", "ARM64"]
2023-12-21 01:34:32 +03:00
name: "*nix·ARM64"
- os: { group: "linux-x86-64" }
2023-12-13 13:42:25 +03:00
container: debian:buster-slim
2023-12-21 01:34:32 +03:00
name: "*nix64"
2023-12-13 13:42:25 +03:00
runs-on: ${{ matrix.platform.os }}
container: ${{ matrix.platform.container }}
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
- uses: pkgxdev/brewkit/build@v1
id: build
with:
pkg: ${{ matrix.pkg }}
- 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
if: steps.build.outputs.pkgspec
2023-12-20 18:37:18 +03:00
# prevent tests passing because the build directory is still there
- name: wipe builds directory
run: |
test -d builds
rm -rf builds
2023-12-21 01:34:32 +03:00
if: steps.build.outputs.pkgspec
2023-12-20 18:37:18 +03:00
2023-12-13 13:42:25 +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 }}
2023-12-13 13:42:25 +03:00
if: steps.build.outputs.pkgspec