Skip to content

Commit e1662b6

Browse files
committed
Use new breakage workflow
1 parent 7e6602d commit e1662b6

File tree

4 files changed

+141
-226
lines changed

4 files changed

+141
-226
lines changed

.github/workflows/Breakage.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Ref: https://securitylab.github.com/research/github-actions-preventing-pwn-requests
2+
name: Breakage
3+
4+
# read-only repo token
5+
# no access to secrets
6+
on:
7+
pull_request:
8+
9+
jobs:
10+
break:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
pkg: [
16+
"JuliaSmoothOptimizers/ADNLPModels.jl",
17+
"JuliaSmoothOptimizers/AmplNLReader.jl",
18+
"JuliaSmoothOptimizers/CaNNOLeS.jl",
19+
"JuliaSmoothOptimizers/CUTEst.jl",
20+
"JuliaSmoothOptimizers/DCI.jl",
21+
"JuliaSmoothOptimizers/JSOSolvers.jl",
22+
"JuliaSmoothOptimizers/LLSModels.jl",
23+
"JuliaSmoothOptimizers/NLPModelsIpopt.jl",
24+
"JuliaSmoothOptimizers/NLPModelsJuMP.jl",
25+
"JuliaSmoothOptimizers/NLPModelsTest.jl",
26+
# "JuliaSmoothOptimizers/PDENLPModels.jl",
27+
"JuliaSmoothOptimizers/Percival.jl",
28+
"JuliaSmoothOptimizers/QuadraticModels.jl",
29+
"JuliaSmoothOptimizers/SolverBenchmark.jl",
30+
"JuliaSmoothOptimizers/SolverTools.jl"
31+
]
32+
pkgversion: [latest, stable]
33+
34+
steps:
35+
- uses: actions/checkout@v2
36+
37+
# Install Julia
38+
- uses: julia-actions/setup-julia@v1
39+
with:
40+
version: 1
41+
arch: x64
42+
- uses: actions/cache@v1
43+
env:
44+
cache-name: cache-artifacts
45+
with:
46+
path: ~/.julia/artifacts
47+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
48+
restore-keys: |
49+
${{ runner.os }}-test-${{ env.cache-name }}-
50+
${{ runner.os }}-test-
51+
${{ runner.os }}-
52+
- uses: julia-actions/julia-buildpkg@v1
53+
54+
# Breakage test
55+
- name: 'Breakage of ${{ matrix.pkg }}, ${{ matrix.pkgversion }} version'
56+
env:
57+
URL: ${{ matrix.pkg }}
58+
VERSION: ${{ matrix.pkgversion }}
59+
run: |
60+
set -v
61+
mkdir -p ./pr
62+
echo "${{ github.event.number }}" > ./pr/NR
63+
git clone https://github.com/$URL
64+
export PKG=$(echo $URL | cut -f2 -d/)
65+
cd $PKG
66+
if [ $VERSION == "stable" ]; then
67+
TAG=$(git tag -l "v*" --sort=-creatordate | head -n1)
68+
if [ -z "$TAG" ]; then
69+
TAG="no_tag"
70+
else
71+
git checkout $TAG
72+
fi
73+
else
74+
TAG=$VERSION
75+
fi
76+
export TAG
77+
julia -e 'using Pkg;
78+
PKG, TAG, VERSION = ENV["PKG"], ENV["TAG"], ENV["VERSION"]
79+
joburl = joinpath(ENV["GITHUB_SERVER_URL"], ENV["GITHUB_REPOSITORY"], "actions/runs", ENV["GITHUB_RUN_ID"])
80+
open("../pr/$PKG-$VERSION", "w") do io
81+
try
82+
TAG == "no_tag" && error("Not tag for $VERSION")
83+
pkg"activate .";
84+
pkg"instantiate";
85+
pkg"dev ../";
86+
pkg"build";
87+
pkg"test";
88+
89+
print(io, "[![](https://img.shields.io/badge/$TAG-Pass-green)]($joburl)");
90+
catch e
91+
@error e;
92+
print(io, "[![](https://img.shields.io/badge/$TAG-Fail-red)]($joburl)");
93+
end;
94+
end'
95+
96+
- uses: actions/upload-artifact@v2
97+
with:
98+
name: pr
99+
path: pr/
100+
101+
upload:
102+
needs: break
103+
runs-on: ubuntu-latest
104+
steps:
105+
- uses: actions/checkout@v2
106+
107+
- uses: actions/download-artifact@v2
108+
with:
109+
name: pr
110+
path: pr/
111+
112+
- run: ls
113+
- run: |
114+
cd pr
115+
echo "| Package name | latest | stable |" > MSG
116+
echo "|--|--|--|" >> MSG
117+
count=0
118+
for file in *
119+
do
120+
[ "$file" == "NR" ] && continue
121+
[ "$file" == "MSG" ] && continue
122+
if [ $count == "0" ]; then
123+
name=$(echo $file | cut -f1 -d-)
124+
echo -n "| $name | "
125+
else
126+
echo -n "| "
127+
fi
128+
cat $file
129+
if [ $count == "0" ]; then
130+
echo -n " "
131+
count=1
132+
else
133+
echo " |"
134+
count=0
135+
fi
136+
done >> MSG
137+
138+
- uses: actions/upload-artifact@v2
139+
with:
140+
name: pr
141+
path: pr/

.github/workflows/breakage.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

test/test-breakage-deploy.jl

Lines changed: 0 additions & 66 deletions
This file was deleted.

test/test-breakage.jl

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)