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:
|
2023-12-13 13:42:25 +03:00
|
|
|
pkgs: ${{ steps.diff.outputs.pkgs }}
|
2022-10-31 21:00:24 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- 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
|
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
|
2023-12-16 01:05:44 +03:00
|
|
|
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:
|
2023-12-15 21:32:55 +03:00
|
|
|
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:
|
2023-12-15 21:32:55 +03:00
|
|
|
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"
|
2023-12-16 01:05:44 +03:00
|
|
|
- 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 }}
|
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
|
|
|
|
|
|
|
|
- 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:
|
|
|
|
pkg: ${{ matrix.pkg }}
|
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:
|
|
|
|
pkg: ${{ matrix.pkg }}
|
2023-12-13 13:42:25 +03:00
|
|
|
if: steps.build.outputs.pkgspec
|