diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aafa119..4b38c9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/bin/info b/bin/info new file mode 100755 index 0000000..5b0a429 --- /dev/null +++ b/bin/info @@ -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 diff --git a/info/postbuild/postbuild.factor b/info/postbuild/postbuild.factor new file mode 100644 index 0000000..c298351 --- /dev/null +++ b/info/postbuild/postbuild.factor @@ -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 \ No newline at end of file