Skip to content

Commit

Permalink
feat: Test matrix
Browse files Browse the repository at this point in the history
Signed-off-by: txtsd <code@ihavea.quest>
  • Loading branch information
txtsd committed Aug 8, 2023
1 parent ea499f5 commit bbc5b70
Showing 1 changed file with 36 additions and 6 deletions.
42 changes: 36 additions & 6 deletions .github/workflows/release_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
container: archlinux:base-devel
timeout-minutes: 5

outputs:
list: ${{ steps.releases.outputs.list_updates }}

steps:
- name: Install dependencies in Arch container
run: |
Expand All @@ -27,22 +30,49 @@ jobs:
with:
fetch-depth: '0'

- name: Grab author and repo name for version check
- name: Check for new releases
id: releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
updates=()
for dir in $(fd --type d)
do
pushd $dir
author_repo=($(sed -nr "s|\s*source[^ ]* =.*https://github.com/([^/]+)/([^\.\/\#]*).*|\1 \2|p" .SRCINFO))
if ! [[ -z "${author_repo+x}" ]]; then
author=${author_repo[0]}
repo=${author_repo[1]}
echo pkg_author=$author >> $GITHUB_ENV
echo pkg_repo=$repo >> $GITHUB_ENV
echo pkg_source=github >> $GITHUB_ENV
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${author}/${repo}/releases -o /tmp/releases.json
echo release_latest=$(jq -r '.[0]["tag_name"]|ltrimstr("v")' < /tmp/releases.json) >> $GITHUB_ENV
echo pb_pkgver=$(sed -nr "s/^pkgver=(\S+)/\1/p" PKGBUILD) >> $GITHUB_ENV
if [[ $release_latest == $pb_pkgver ]];
then
updates+=("${dir}")
fi
else
echo "source is not github"
fi
popd
done
set +x
echo "list_updates=$(jq -cn '$ARGS.positional' --args "${updates[@]}")" >> $GITHUB_OUTPUT
now_build:
needs: release_check
runs-on: ubuntu-latest
container: archlinux:base-devel
strategy:
matrix:
package: ${{ fromJson(needs.release_check.outputs.list) }}

steps:
- name: Test
run: |
echo ${{ matrix.package }}

0 comments on commit bbc5b70

Please sign in to comment.