Skip to content

Commit fdfccc8

Browse files
committed
Add docker support to test compilation on Linux
1 parent 14db298 commit fdfccc8

File tree

6 files changed

+36
-4
lines changed

6 files changed

+36
-4
lines changed

.github/workflows/android-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
- name: Create NDK folder
2626
run: |
27-
sudo mkdir ${ANDROID_HOME}/ndk
27+
sudo mkdir -p ${ANDROID_HOME}/ndk
2828
sudo chmod -R a+rwx ${ANDROID_HOME}/ndk
2929
sudo chown -R $USER:$USER ${ANDROID_HOME}/ndk
3030

.github/workflows/unit-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-20.04
1212

1313
steps:
1414
- name: Checkout
@@ -17,7 +17,7 @@ jobs:
1717
- name: Install Linux dependencies
1818
run: |
1919
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
20-
echo 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main' | sudo tee -a /etc/apt/sources.list.d/llvm.list
20+
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal main' | sudo tee -a /etc/apt/sources.list.d/llvm.list
2121
sudo add-apt-repository ppa:linuxgndu/sqlcipher -y
2222
2323
sudo apt-get update -y

cpp/build.sh

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
11
#!/bin/sh
2-
cmake -Bcmake-build-debug && make -C cmake-build-debug
2+
3+
GREEN='\033[0;32m'
4+
CYAN='\033[0;36m'
5+
NC='\033[0m'
6+
7+
if [ -f /.dockerenv ]; then
8+
printf "\n💡 ${GREEN}Building outside volume for better performance: ${CYAN}../cmake-build-debug${NC}\n\n"
9+
cmake -B../cmake-build-debug && make -C ../cmake-build-debug
10+
cp clear-gcda.sh ../cmake-build-debug
11+
else
12+
cmake -Bcmake-build-debug && make -C cmake-build-debug
13+
cp clear-gcda.sh cmake-build-debug
14+
fi

docker/Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM ubuntu:focal
2+
3+
RUN apt-get update
4+
RUN apt-get install -y software-properties-common wget
5+
RUN add-apt-repository ppa:linuxgndu/sqlcipher -y
6+
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
7+
RUN echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal main' | tee -a /etc/apt/sources.list.d/llvm.list
8+
RUN apt-get update && apt-get install -y libsqlcipher-dev llvm clang cmake zlib1g-dev

docker/docker-bash.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
clear && docker exec -w /Inspector -it Inspector bash

docker/docker-compose.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: '3'
2+
services:
3+
inspector:
4+
build: .
5+
image: pakerwreah/inspector
6+
container_name: Inspector
7+
stdin_open: true
8+
tty: true
9+
volumes:
10+
- '../cpp:/Inspector:cached'

0 commit comments

Comments
 (0)