Skip to content

Commit 1594f9e

Browse files
committed
Test Docker Host Files Access
1 parent 133da50 commit 1594f9e

File tree

1 file changed

+37
-33
lines changed

1 file changed

+37
-33
lines changed

.github/workflows/linux_arch.yml

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,44 +13,48 @@ jobs:
1313
build:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
16+
- name: Check out the repository
17+
uses: actions/checkout@v4
18+
1719
- name: Set up Docker Buildx
1820
uses: docker/setup-buildx-action@v2
19-
- name: Build and Run Arch Linux Container
21+
22+
- name: Build Arch Linux Docker Image
2023
run: |
2124
docker build -t archlinux:latest - <<EOF
2225
FROM archlinux:latest
2326
RUN pacman -Syu --noconfirm npm make gcc clang llvm lld
2427
EOF
25-
docker run --name archlinux_container -d archlinux:latest tail -f /dev/null
26-
- name: Execute Build Steps in Container
27-
run: |
28-
docker exec archlinux_container bash -c "
29-
npm i -g esbuild &&
30-
chmod +x bridge/build.sh &&
31-
./bridge/build.sh &&
32-
make debug &&
33-
make &&
34-
make WEBUI_USE_TLS=1 debug &&
35-
make WEBUI_USE_TLS=1 &&
36-
examples_base_dir=\$(pwd)/examples/C &&
37-
for example in \$(find \$examples_base_dir/* -maxdepth 0 -type d); do
38-
echo \"> \$example\"
39-
cd \$example || { exit_code=1; continue; }
40-
if ! make; then
41-
echo \"Failed to build '\$example'\"
42-
exit_code=1
43-
continue
44-
fi
45-
if [[ ! -e \"main\" || ! -e \"main-dyn\" ]]; then
46-
echo \"Failed to find executable for '\$example'\" && find .
47-
exit_code=1
48-
continue
49-
fi
50-
done
51-
exit \$exit_code
52-
"
53-
- name: Clean Up
28+
29+
- name: Run build inside Arch Linux container
5430
run: |
55-
docker stop archlinux_container
56-
docker rm archlinux_container
31+
docker run --rm \
32+
-v ${{ github.workspace }}:/workspace \
33+
-w /workspace \
34+
archlinux:latest \
35+
bash -c "
36+
npm i -g esbuild &&
37+
chmod +x bridge/build.sh &&
38+
./bridge/build.sh &&
39+
make debug &&
40+
make &&
41+
make WEBUI_USE_TLS=1 debug &&
42+
make WEBUI_USE_TLS=1 &&
43+
examples_base_dir=\$(pwd)/examples/C &&
44+
exit_code=0 &&
45+
for example in \$(find \$examples_base_dir/* -maxdepth 0 -type d); do
46+
echo \"> \$example\"
47+
cd \$example || { exit_code=1; continue; }
48+
if ! make; then
49+
echo \"Failed to build '\$example'\"
50+
exit_code=1
51+
continue
52+
fi
53+
if [[ ! -e \"main\" || ! -e \"main-dyn\" ]]; then
54+
echo \"Failed to find executable for '\$example'\" && find .
55+
exit_code=1
56+
continue
57+
fi
58+
done
59+
exit \$exit_code
60+
"

0 commit comments

Comments
 (0)