Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle empty deps in Breakage #6

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/Breakage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,18 @@ jobs:
julia --project=.breakage -e 'using Pkg; Pkg.update(); Pkg.instantiate()'
pkgs=$(julia --project=.breakage .breakage/get_jso_users.jl ${{ env.pkg }})
vs='["latest", "stable"]'
# Check if pkgs is empty, and set it to a JSON array if necessary
if [[ -z "$pkgs" || "$pkgs" == "String[]" ]]; then
echo "No packages found; exiting successfully."
exit 0
fi
vs='["latest", "stable"]'
matrix=$(jq -cn --argjson deps "$pkgs" --argjson vers "$vs" '{pkg: $deps, pkgversion: $vers}') # don't escape quotes like many posts suggest
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"

break:
needs: setup_matrix
if: needs.setup_matrix.result == 'success' && needs.setup_matrix.outputs.matrix != ''
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -67,8 +74,9 @@ jobs:
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1

# Breakage test
- name: "Breakage of ${{ matrix.pkg }}, ${{ matrix.pkgversion }} version"
- name: 'Breakage of ${{ matrix.pkg }}, ${{ matrix.pkgversion }} version'
env:
PKG: ${{ matrix.pkg }}
VERSION: ${{ matrix.pkgversion }}
Expand All @@ -93,7 +101,7 @@ jobs:
joburl = joinpath(ENV["GITHUB_SERVER_URL"], ENV["GITHUB_REPOSITORY"], "actions/runs", ENV["GITHUB_RUN_ID"])
open("../breakage/breakage-$PKG-$VERSION", "w") do io
try
TAG == "no_tag" && error("Not tag for $VERSION")
TAG == "no_tag" && error("No tag for $VERSION")
pkg"activate .";
pkg"instantiate";
pkg"dev ../";
Expand Down
Loading