Skip to content

Commit

Permalink
update action
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-kan committed Mar 14, 2024
1 parent 5b3ae0d commit 559b832
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,14 @@ jobs:
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: BASE_IMAGE=ubuntu:noble

- name: Run Tests
continue-on-error: true
run: docker run -e CTEST_OUTPUT_ON_FAILURE=1 --rm ${{ steps.meta.outputs.tags }} sh -c "cmake --build \$HOME/sysu/build -t test"
uses: addnab/docker-run-action@v3
with:
image: ${{ steps.meta.outputs.tags }}
run: |
CTEST_OUTPUT_ON_FAILURE=1 cmake --build $HOME/sysu/build -t test
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
Expand All @@ -79,5 +82,4 @@ jobs:
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: BASE_IMAGE=ubuntu:noble
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/ppc64le,linux/s390x
34 changes: 17 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# syntax=docker/dockerfile:1.4
ARG BASE_IMAGE=ubuntu:noble
FROM ${BASE_IMAGE}
WORKDIR /opt/SYsU-lang
COPY <<build_install.sh <<run.sh . /opt/SYsU-lang
WORKDIR /root/SYsU-lang
COPY <<build_install.sh <<run.sh . /root/SYsU-lang
#!/bin/sh
rm -rf \$2
cmake -G Ninja \\
Expand All @@ -19,16 +19,16 @@ cmake --build \$2/build -j
cmake --build \$2/build -t install
build_install.sh
#!/bin/sh
python3 -m tarfile -e /autograder/submission/*.tar.gz /opt/SYsU-lang/submission
rm -rf /opt/SYsU-lang/generator
cp -r /opt/SYsU-lang/submission/*-Source/generator /opt/SYsU-lang
rm -rf /opt/SYsU-lang/optimizer
cp -r /opt/SYsU-lang/submission/*-Source/optimizer /opt/SYsU-lang
rm -rf /opt/SYsU-lang/submission
/opt/SYsU-lang/build_install.sh /opt/SYsU-lang /opt/sysu
python3 -m tarfile -e /autograder/submission/*.tar.gz /root/SYsU-lang/submission
rm -rf /root/SYsU-lang/generator
cp -r /root/SYsU-lang/submission/*-Source/generator /root/SYsU-lang
rm -rf /root/SYsU-lang/rootimizer
cp -r /root/SYsU-lang/submission/*-Source/rootimizer /root/SYsU-lang
rm -rf /root/SYsU-lang/submission
/root/SYsU-lang/build_install.sh /root/SYsU-lang /root/sysu
sysu-compiler \\
--unittest=benchmark_generator_and_optimizer_1 \\
"/opt/SYsU-lang/**/*.sysu.c" >/autograder/results/results.json
"/root/SYsU-lang/**/*.sysu.c" >/autograder/results/results.json
run.sh
RUN <<EOF
apt-get update -y
Expand All @@ -40,12 +40,12 @@ apt-get autoremove -y
apt-get clean -y
rm -rf /var/lib/apt/lists/*
mkdir -p /autograder/results
mv /opt/SYsU-lang/run.sh /autograder/run
mv /root/SYsU-lang/run.sh /autograder/run
chmod +x /autograder/run
chmod +x /opt/SYsU-lang/build_install.sh
/opt/SYsU-lang/build_install.sh /opt/SYsU-lang /opt/sysu
chmod +x /root/SYsU-lang/build_install.sh
/root/SYsU-lang/build_install.sh /root/SYsU-lang /root/sysu
EOF
ENV PATH=/opt/sysu/bin:$PATH \
CPATH=/opt/sysu/include:$CPATH \
LIBRARY_PATH=/opt/sysu/lib:$LIBRARY_PATH \
LD_LIBRARY_PATH=/opt/sysu/lib:$LD_LIBRARY_PATH
ENV PATH=/root/sysu/bin:$PATH \
CPATH=/root/sysu/include:$CPATH \
LIBRARY_PATH=/root/sysu/lib:$LIBRARY_PATH \
LD_LIBRARY_PATH=/root/sysu/lib:$LD_LIBRARY_PATH

0 comments on commit 559b832

Please sign in to comment.