2022-08-05 15:38:16 +02:00
|
|
|
---
|
|
|
|
name: PR checks
|
|
|
|
|
|
|
|
"on":
|
|
|
|
pull_request_target:
|
|
|
|
types:
|
|
|
|
- opened
|
|
|
|
- synchronize
|
|
|
|
- reopened
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ci-${{ github.event.number }}
|
|
|
|
cancel-in-progress: false
|
|
|
|
|
|
|
|
env:
|
2024-02-03 01:23:23 +01:00
|
|
|
# renovate: datasource=docker depName=aclemons/sbo-maintainer-tools versioning=docker
|
|
|
|
SBO_MAINTAINER_TOOLS_IMAGE: aclemons/sbo-maintainer-tools:0.9.0-15.0@sha256:a857eeb783622430a77ffdc0e9be0fa7d38b4d30696f362454eb990614a5ade8
|
2022-08-05 15:38:16 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
changes:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
|
|
steps:
|
2024-02-03 01:23:23 +01:00
|
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2022-08-05 15:38:16 +02:00
|
|
|
with:
|
2024-02-03 01:23:23 +01:00
|
|
|
show-progress: false
|
2022-08-05 15:38:16 +02:00
|
|
|
fetch-depth: 2
|
|
|
|
ref: ${{ github.head_ref }}
|
2023-09-03 03:07:41 +02:00
|
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
2022-08-05 15:38:16 +02:00
|
|
|
|
|
|
|
- name: Get slackbuild directories which have changes.
|
|
|
|
id: changed-dirs
|
2024-02-03 01:23:23 +01:00
|
|
|
uses: tj-actions/changed-files@90a06d6ba9543371ab4df8eeca0be07ca6054959 # v42.0.2
|
2022-08-05 15:38:16 +02:00
|
|
|
with:
|
2023-09-03 03:07:41 +02:00
|
|
|
base_sha: ${{ github.event.pull_request.base.sha }}
|
2022-08-05 15:38:16 +02:00
|
|
|
dir_names: true
|
|
|
|
dir_names_exclude_current_dir: true
|
|
|
|
dir_names_max_depth: 2
|
|
|
|
json: true
|
|
|
|
quotepath: false
|
|
|
|
files_ignore: .github/**
|
|
|
|
|
|
|
|
- name: List all changed files
|
|
|
|
run: echo '${{ steps.changed-dirs.outputs.all_changed_files }}'
|
|
|
|
|
|
|
|
- name: Get matrix output
|
|
|
|
id: set-matrix
|
|
|
|
run: |
|
|
|
|
{
|
|
|
|
printf 'matrix<<SLACKBUILDS\n'
|
|
|
|
jq -r -c 'map({dir: .})' <<< "${{ steps.changed-dirs.outputs.all_changed_files }}"
|
|
|
|
printf 'SLACKBUILDS\n'
|
|
|
|
} >> "$GITHUB_OUTPUT"
|
|
|
|
|
|
|
|
sbolint:
|
|
|
|
name: Checks with sbolint
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pull-requests: write
|
|
|
|
needs: [changes]
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include: ${{ fromJSON(needs.changes.outputs.matrix) }}
|
|
|
|
steps:
|
2024-02-03 01:23:23 +01:00
|
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2022-08-05 15:38:16 +02:00
|
|
|
with:
|
2024-02-03 01:23:23 +01:00
|
|
|
show-progress: false
|
2022-08-05 15:38:16 +02:00
|
|
|
ref: ${{ github.head_ref }}
|
2023-09-03 03:07:41 +02:00
|
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
2022-08-05 15:38:16 +02:00
|
|
|
|
|
|
|
- name: Run sbolint
|
|
|
|
run: |
|
2024-02-03 01:23:23 +01:00
|
|
|
docker pull ${{ env.SBO_MAINTAINER_TOOLS_IMAGE }}
|
2022-08-05 15:38:16 +02:00
|
|
|
|
|
|
|
mkfifo pipe
|
|
|
|
tee sbolint-output < pipe &
|
|
|
|
set +e
|
|
|
|
|
2024-02-03 01:23:23 +01:00
|
|
|
docker run --rm -v "$(pwd):/work" -w /work ${{ env.SBO_MAINTAINER_TOOLS_IMAGE }} sbolint "${{ matrix.dir }}" > pipe 2>&1
|
2022-08-05 15:38:16 +02:00
|
|
|
|
|
|
|
sbolint_status="$?"
|
|
|
|
set -e
|
|
|
|
|
|
|
|
{
|
|
|
|
if [[ "$sbolint_status" -eq 0 ]] ; then
|
|
|
|
printf '#### ✅ sbolint - %s\n\n' "${{ matrix.dir }} ✅"
|
|
|
|
else
|
|
|
|
printf '#### ⛔️ sbolint - %s\n\n' "${{ matrix.dir }} ⛔️"
|
|
|
|
fi
|
|
|
|
|
|
|
|
printf '```\n'
|
|
|
|
cat sbolint-output
|
|
|
|
rm sbolint-output
|
|
|
|
printf '```\n'
|
|
|
|
} > comment-output
|
|
|
|
shell:
|
|
|
|
bash
|
|
|
|
|
|
|
|
- name: Comment with sbolint results
|
2024-02-03 01:23:23 +01:00
|
|
|
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
|
2022-08-05 15:38:16 +02:00
|
|
|
with:
|
|
|
|
issue-number: ${{ github.event.number }}
|
|
|
|
body-path: comment-output
|
2024-04-08 13:27:05 +02:00
|
|
|
|
|
|
|
dependencies:
|
|
|
|
name: Compute reverse dependencies
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pull-requests: write
|
|
|
|
needs: [changes]
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include: ${{ fromJSON(needs.changes.outputs.matrix) }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
|
|
with:
|
|
|
|
show-progress: false
|
|
|
|
ref: ${{ github.head_ref }}
|
|
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
|
|
|
|
|
|
- name: Get short package name
|
|
|
|
run: printf '%s\n' "${{ matrix.dir }}" | cut -d/ -f2 | sed 's/^/PACKAGE_NAME=/' >> "$GITHUB_ENV"
|
|
|
|
|
|
|
|
- name: Look up dependencies
|
|
|
|
id: get_deps
|
|
|
|
uses: fjogeleit/http-request-action@8af28031091191b8e41afb287e0e56fce753c7b4 # v1.15.4
|
|
|
|
with:
|
|
|
|
url: 'https://slackbuilds.org/revdeps.php?q=${{ env.PACKAGE_NAME }}'
|
|
|
|
method: 'GET'
|
|
|
|
preventFailureOnNoResponse: "true"
|
|
|
|
|
|
|
|
- name: Build comment
|
|
|
|
run: |
|
|
|
|
{
|
|
|
|
printf '#### reverse dependencies - %s\n\n' "${{ matrix.dir }}"
|
|
|
|
if [[ ${{ steps.get_deps.outputs.response }} == "" ]] ; then
|
|
|
|
printf 'None\n'
|
|
|
|
else
|
|
|
|
printf '```\n'
|
|
|
|
printf '%s' ${{ steps.get_deps.outputs.response }} | sed 's/\\n/\n/g' | sort
|
|
|
|
printf '```\n'
|
|
|
|
fi
|
|
|
|
} > comment-output
|
|
|
|
shell:
|
|
|
|
bash
|
|
|
|
|
|
|
|
- name: Comment with dependeny results
|
|
|
|
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
|
|
|
|
with:
|
|
|
|
issue-number: ${{ github.event.number }}
|
|
|
|
body-path: comment-output
|