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

Add Factor Build Info to summary #3

Closed
wants to merge 14 commits into from
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ on:
push:
branches:
- main
- test
pull_request:

jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.repository == 'codewars/factor' }}
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v2
Expand All @@ -27,6 +27,9 @@ jobs:
- name: Run Passing Example
run: bin/run passing

- name: Report Postbuild Info
run: bin/info >> $GITHUB_STEP_SUMMARY

- name: Report Image Size
run: |
echo "## Image Size" >> $GITHUB_STEP_SUMMARY
Expand Down
12 changes: 12 additions & 0 deletions bin/info
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eu

W=/workspace/
# Create a container
C=$(docker container create --rm -w $W ghcr.io/codewars/factor:latest factor -run=postbuild)

# Copy files from the current directory
docker container cp info/. $C:$W

# Run tests
docker container start --attach $C
16 changes: 16 additions & 0 deletions info/postbuild/postbuild.factor
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
! copyright 2024 nomennescio
USING: kernel io compiler.errors tools.errors assocs namespaces source-files.errors accessors sequences prettyprint sequences.extras sets ;
IN: postbuild

: report-missing-libraries ( -- )
linkage-errors get values [ error>> no-such-library? ] [ error>> name>> ] filter-map members
[ "## Missing libraries" print
[ print ] each
] unless-empty
;

: run ( -- )
report-missing-libraries
;

MAIN: run
Loading