Skip to content

Update BreakageApplication.yml #483

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

Merged
merged 2 commits into from
Apr 30, 2025
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
138 changes: 9 additions & 129 deletions .github/workflows/BreakageApplication.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Ref: https://securitylab.github.com/research/github-actions-preventing-pwn-requests
name: BreakageApplication
name: Breakage Application

# read-only repo token
# no access to secrets
Expand All @@ -9,136 +9,16 @@ on:

jobs:
break:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'run breakage applications')
strategy:
fail-fast: false
matrix:
pkg: [
"control-toolbox/CalculusOfVariations.jl",
"control-toolbox/LossControl.jl",
"control-toolbox/GeometricPreconditioner.jl",
"control-toolbox/MedicalResonanceImaging.jl",
"control-toolbox/Kepler.jl"
]
pkgname: [CalculusOfVariations, LossControl, GeometricPreconditioner, MedicalResonanceImaging, Kepler]
pkgversion: [latest, stable]

steps:
- uses: actions/checkout@v4

# Install Julia
- uses: julia-actions/setup-julia@latest
with:
version: 1
arch: x64
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1

# Breakage test
- name: 'Breakage of ${{ matrix.pkg }}, ${{ matrix.pkgversion }} version'
env:
URL: ${{ matrix.pkg }}
VERSION: ${{ matrix.pkgversion }}
run: |
set -v
mkdir -p ./pr
echo "${{ github.event.number }}" > ./pr/NR
#
PKG_SRC_PATH=`pwd`
PKG_SRC_NAME=`basename -s ".jl" $PKG_SRC_PATH`
#
git clone https://github.com/$URL
export PKG=$(echo $URL | cut -f2 -d/)
cd $PKG
if [ $VERSION == "stable" ]; then
TAG=$(git tag -l "v*" --sort=-creatordate | head -n1)
if [ -z "$TAG" ]; then
TAG="no_tag"
else
git checkout $TAG
fi
else
TAG=$VERSION
fi
export TAG
#
PKG_SRC_VERSION=$(julia --project=docs/ -e 'using Pkg, Logging; with_logger(NullLogger()) do; Pkg.instantiate(); Pkg.installed()["'$PKG_SRC_NAME'"] |> println; end')
export PKG_SRC_VERSION
#
julia -e 'using Pkg;
PKG, TAG, VERSION, PKG_SRC_VERSION = ENV["PKG"], ENV["TAG"], ENV["VERSION"], ENV["PKG_SRC_VERSION"]
joburl = joinpath(ENV["GITHUB_SERVER_URL"], ENV["GITHUB_REPOSITORY"], "actions/runs", ENV["GITHUB_RUN_ID"])
open("../pr/$PKG-$VERSION", "w") do io
try
TAG == "no_tag" && error("Not tag for $VERSION")
pkg"activate docs";
pkg"instantiate";
pkg"status";
pkg"dev ../";
pkg"build";
include("docs/make.jl");

print(io, "[![](https://img.shields.io/badge/$TAG-Pass-green)]($joburl) compat: v", PKG_SRC_VERSION);
catch e
@error e;
print(io, "[![](https://img.shields.io/badge/$TAG-Fail-red)]($joburl) compat: v", PKG_SRC_VERSION);
end;
end'

- uses: actions/upload-artifact@v3
with:
name: pr
path: pr/

upload:
needs: break
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
name: pr
path: pr/

- run: ls
- run: |
cd pr
echo "Breakage test results" > MSG
echo "Date: $(TZ=UTC-2 date '+%Y-%m-%d %H:%M:%S')" >> MSG
echo "| Application name | latest | stable |" >> MSG
echo "|--|--|--|" >> MSG
count=0
for file in *
do
[ "$file" == "NR" ] && continue
[ "$file" == "MSG" ] && continue
if [ $count == "0" ]; then
name=$(echo $file | sed 's|\(.*\)-.*|\1|')
echo -n "| $name | "
else
echo -n "| "
fi
cat $file
if [ $count == "0" ]; then
echo -n " "
count=1
else
echo " |"
count=0
fi
done >> MSG

- uses: actions/upload-artifact@v3
with:
name: pr
path: pr/
include:
- pkgpath: control-toolbox
uses: control-toolbox/CTActions/.github/workflows/breakage-application..yml@main
with:
pkgname: ${{ matrix.pkgname }}
pkgpath: ${{ matrix.pkgpath }}
pkgversion: ${{ matrix.pkgversion }}
Loading