Skip to content

Commit 1cf1909

Browse files
authored
Merge pull request #4 from nomennescio/main
Add Factor Build Info to summary
2 parents ff12eb4 + 00eba8b commit 1cf1909

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

.github/workflows/ci.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ on:
33
push:
44
branches:
55
- main
6+
- test
67
pull_request:
78

89
jobs:
910
build:
1011
runs-on: ubuntu-latest
11-
if: ${{ github.repository == 'codewars/factor' }}
1212
steps:
1313
- uses: actions/checkout@v4
1414
- uses: docker/setup-buildx-action@v2
@@ -27,6 +27,9 @@ jobs:
2727
- name: Run Passing Example
2828
run: bin/run passing
2929

30+
- name: Report Postbuild Info
31+
run: bin/info >> $GITHUB_STEP_SUMMARY
32+
3033
- name: Report Image Size
3134
run: |
3235
echo "## Image Size" >> $GITHUB_STEP_SUMMARY

bin/info

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
W=/workspace/
5+
# Create a container
6+
C=$(docker container create --rm -w $W ghcr.io/codewars/factor:latest factor -run=postbuild)
7+
8+
# Copy files from the current directory
9+
docker container cp info/. $C:$W
10+
11+
# Run tests
12+
docker container start --attach $C

info/postbuild/postbuild.factor

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
! copyright 2024 nomennescio
2+
USING: accessors assocs compiler.errors io kernel namespaces prettyprint sequences sequences.extras sets source-files.errors tools.errors ;
3+
IN: postbuild
4+
5+
: report-missing-libraries ( -- )
6+
linkage-errors get values [ error>> no-such-library? ] [ error>> name>> ] filter-map members
7+
[ "## Missing libraries" print
8+
[ print ] each
9+
] unless-empty
10+
;
11+
12+
: run ( -- )
13+
report-missing-libraries
14+
;
15+
16+
MAIN: run

0 commit comments

Comments
 (0)