Skip to content

Commit e060885

Browse files
committed
Merge branch 'master' of https://github.com/ocaml-sf/learn-ocaml into pr/481 (to-be-rebased)
* 'master' of https://github.com/ocaml-sf/learn-ocaml: fix(learnocaml_report.css): Display multiple spaces in code excerpts (ocaml-sf#503) ci(pin-artifacts.yml): Add build artifacts links within upstream commits status (ocaml-sf#501) deps(opam): Bump ssl (0.5.10 -> 0.5.12) (ocaml-sf#499) build(static-binaries): Fix building of static binaries on CI (ocaml-sf#497)
2 parents f7b0b96 + c1054ab commit e060885

File tree

7 files changed

+51
-5
lines changed

7 files changed

+51
-5
lines changed

.github/workflows/pin-artifacts.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Pin artifacts
2+
on:
3+
workflow_run:
4+
workflows: ["Generate static binaries"]
5+
types: ["completed"]
6+
7+
jobs:
8+
# Make artifacts links more visible for the upstream project
9+
pin-artifacts:
10+
permissions:
11+
statuses: write
12+
name: Add artifacts links to commit statuses
13+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository == 'ocaml-sf/learn-ocaml' }}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Add artifacts links to commit status
17+
run: |
18+
set -x
19+
workflow_id=${{ github.event.workflow_run.workflow_id }}
20+
run_id=${{ github.event.workflow_run.id }} # instead of ${{ github.run_id }}
21+
run_number=${{ github.event.workflow_run.run_number }}
22+
head_branch=${{ github.event.workflow_run.head_branch }}
23+
head_sha=${{ github.event.workflow_run.head_sha }} # instead of ${{ github.event.pull_request.head.sha }} (or ${{ github.sha }})
24+
check_suite_id=${{ github.event.workflow_run.check_suite_id }}
25+
set +x
26+
27+
curl \
28+
-H "Accept: application/vnd.github+json" \
29+
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${run_id}/artifacts" \
30+
| jq '[.artifacts | .[] | {"id": .id, "name": .name, "created_at": .created_at, "expires_at": .expires_at, "archive_download_url": .archive_download_url}] | sort_by(.name)' \
31+
> artifacts.json
32+
33+
cat artifacts.json
34+
35+
< artifacts.json jq -r ".[] | \
36+
.name + \"§\" + \
37+
( .id | tostring | \"https://github.com/${{ github.repository }}/suites/${check_suite_id}/artifacts/\" + . ) + \"§\" + \
38+
( \"Link to \" + .name + \".zip [\" + ( .created_at | sub(\"T.*\"; \"→\") ) + ( .expires_at | sub(\"T.*\"; \"] (you must be logged)\" ) ) )" \
39+
| while IFS="§" read name url descr; do
40+
curl \
41+
-X POST \
42+
-H "Accept: application/vnd.github+json" \
43+
-H "Authorization: Bearer ${{ github.token }}" \
44+
"https://api.github.com/repos/${{ github.repository }}/statuses/${head_sha}" \
45+
-d "$( printf '{"state":"%s","target_url":"%s","description":"%s","context":"%s"}' "${{ github.event.workflow_run.conclusion }}" "$url" "$descr" "$name (artifact)" )"
46+
done

.github/workflows/static-builds.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ jobs:
5353
run: |
5454
bin=(./learn-ocaml-client ./learn-ocaml-server ./learn-ocaml)
5555
file "${bin[@]}"
56-
ldd "${bin[@]}"
5756
for b in "${bin[@]}"; do ( set -x; "$b" --version ); done
5857
- name: Archive static binaries
5958
run: |

learn-ocaml-client.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ depends: [
4242
"ppxlib"
4343
"ppx_sexp_conv"
4444
"ppx_tools"
45-
"ssl" {= "0.5.10"}
45+
"ssl" {= "0.5.12"}
4646
"vg"
4747
]
4848
build: [

learn-ocaml-client.opam.locked

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ depends: [
9595
"seq" {= "0.2.2"}
9696
"sexplib" {= "v0.14.0"}
9797
"sexplib0" {= "v0.14.0"}
98-
"ssl" {= "0.5.10"}
98+
"ssl" {= "0.5.12"}
9999
"stdlib-shims" {= "0.3.0"}
100100
"stringext" {= "1.6.0"}
101101
"topkg" {= "1.0.3"}

learn-ocaml.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ depends: [
5959
"ppx_tools"
6060
"ppx_tools_versioned"
6161
"re"
62-
"ssl" {= "0.5.10"}
62+
"ssl" {= "0.5.12"}
6363
"uutf" {>= "1.0" }
6464
"vg"
6565
"yojson" {>= "1.4.0" }

learn-ocaml.opam.locked

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ depends: [
107107
"seq" {= "0.2.2"}
108108
"sexplib" {= "v0.14.0"}
109109
"sexplib0" {= "v0.14.0"}
110-
"ssl" {= "0.5.10"}
110+
"ssl" {= "0.5.12"}
111111
"stdlib-shims" {= "0.3.0"}
112112
"stringext" {= "1.6.0"}
113113
"topkg" {= "1.0.3"}

static/css/learnocaml_report.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
}
1919
#learnocaml-report .code {
2020
font-family: 'Inconsolata', monospace;
21+
white-space: pre-wrap;
2122
display: inline;
2223
font-size: 18px;
2324
line-height: 18px;

0 commit comments

Comments
 (0)