-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile and GH workflow for Arch Linux
Apart from having a CI for yet another flavour of Linux, I wanted to see whether I can reproduce the failure reported in #39. That's not the case, so I suggest that we close #39.
- Loading branch information
1 parent
5562473
commit ee8da86
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: docker-archlinux | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build the Docker image | ||
run: docker build . --file Dockerfile_archlinux --tag llvm-tutor:llvm-12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# ============================================================================= | ||
# An Arch Linux docker file for llvm-tutor. Clones and builds llvm-tutor, runs | ||
# all tests. It uses the precompiled LLVM packages from Fedora. | ||
# | ||
# USAGE: | ||
# ```bash | ||
# wget https://raw.githubusercontent.com/banach-space/llvm-tutor/main/Dockerfile_archlinux | ||
# docker build -t=llvm-tutor:llvm-12 . | ||
# docker run --rm -it --hostname=llvm-tutor llvm-tutor:llvm-12 /bin/bash | ||
# ``` | ||
# ============================================================================= | ||
|
||
FROM archlinux | ||
|
||
ENV LLVM_DIR /usr/ | ||
ENV TUTOR_DIR /llvm-tutor | ||
|
||
# 1. INSTALL DEPENDENCIES | ||
RUN pacman -Syu --noconfirm \ | ||
git \ | ||
cmake \ | ||
ninja \ | ||
gcc \ | ||
llvm \ | ||
clang \ | ||
python-pip | ||
|
||
# 2. INSTALL LIT | ||
RUN pip3 install lit | ||
|
||
# 3. CLONE LLVM-TUTOR | ||
RUN git clone https://github.com/banach-space/llvm-tutor $TUTOR_DIR | ||
|
||
# 4. BUILD AND RUN HELLO-WORLD | ||
RUN mkdir -p $TUTOR_DIR/hello-world-build \ | ||
&& cd $TUTOR_DIR/hello-world-build \ | ||
&& cmake -G Ninja -DLT_LLVM_INSTALL_DIR=$LLVM_DIR ../HelloWorld \ | ||
&& ninja | ||
RUN cd $TUTOR_DIR/hello-world-build && $LLVM_DIR/bin/clang -S -O1 -emit-llvm ../inputs/input_for_hello.c -o input_for_hello.ll | ||
RUN cd $TUTOR_DIR/hello-world-build && $LLVM_DIR/bin/opt -load-pass-plugin ./libHelloWorld.so -passes=hello-world -disable-output input_for_hello.ll 2>&1 | grep "(llvm-tutor) Hello from: foo" | ||
|
||
# 5. BUILD AND RUN LLVM-TUTOR | ||
RUN mkdir -p $TUTOR_DIR/build \ | ||
&& cd $TUTOR_DIR/build \ | ||
&& cmake -G Ninja -DLT_LLVM_INSTALL_DIR=$LLVM_DIR ../ \ | ||
&& ninja \ | ||
&& lit test/ |