Skip to content

Commit

Permalink
Merge pull request #4 from nomennescio/main
Browse files Browse the repository at this point in the history
Add Factor Build Info to summary
  • Loading branch information
nomennescio authored Jan 24, 2024
2 parents ff12eb4 + 00eba8b commit 1cf1909
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
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: accessors assocs compiler.errors io kernel namespaces prettyprint sequences sequences.extras sets source-files.errors tools.errors ;
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

0 comments on commit 1cf1909

Please sign in to comment.