Skip to content

Commit

Permalink
Make Xvfb a layer
Browse files Browse the repository at this point in the history
  • Loading branch information
angelsl committed Aug 17, 2020
1 parent f30e10f commit 5250fc3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,6 @@ jobs:
name: build-lambda
- name: Rebuild native modules
run: scripts/build-lambda-grader-in-docker.sh
- uses: actions/upload-artifact@v2
with:
name: build-lambda
path: build.tar.bz2
if-no-files-found: error
xvfb:
name: Build Xvfb
runs-on: ubuntu-latest
container: lambci/lambda:build-nodejs12.x
steps:
- uses: actions/checkout@master
- name: Build Xvfb
run: scripts/build-lambda-xvfb.sh
- uses: actions/upload-artifact@v2
with:
name: xvfb
path: /var/task/xvfb.tar.bz2
if-no-files-found: error
combine:
name: Combine artifacts
needs: [xvfb, native]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: build-lambda
- uses: actions/download-artifact@v2
with:
name: xvfb
- name: Combine results
run: |
tar jxf build.tar.bz2
cd build
tar jxf ../xvfb.tar.bz2
zip -r ../grader.zip *
- uses: actions/upload-artifact@v2
with:
name: graderzip
Expand All @@ -76,6 +41,4 @@ jobs:
- uses: geekyeggo/delete-artifact@v1
with:
failOnError: false
name: |
build-lambda
xvfb
name: build-lambda
17 changes: 17 additions & 0 deletions .github/workflows/build-xvfb-layer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Build layer
on: workflow_dispatch

jobs:
xvfb:
name: Build Xvfb
runs-on: ubuntu-latest
container: lambci/lambda:build-nodejs12.x
steps:
- uses: actions/checkout@master
- name: Build Xvfb
run: scripts/build-lambda-xvfb.sh
- uses: actions/upload-artifact@v2
with:
name: xvfbzip
path: /opt/xvfb.zip
if-no-files-found: error
5 changes: 1 addition & 4 deletions scripts/build-lambda-grader-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,4 @@ for lib in $NEEDED_LIBS; do
fi
done

cd ..

rm build.tar.bz2
tar jcf build.tar.bz2 build
zip -r ../grader.zip *
14 changes: 7 additions & 7 deletions scripts/build-lambda-xvfb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ tar jxf "xkeyboard-config-$XKEYBOARD_CONFIG_VER.tar.bz2"
tar jxf "xorg-server-$XORG_VER.tar.bz2"
tar jxf "xkbcomp-$XKBCOMP_VER.tar.bz2"

export LD_LIBRARY_PATH=/var/task
export PKG_CONFIG_PATH=/var/task/share/pkgconfig:/var/task/lib/pkgconfig
export LD_LIBRARY_PATH=/opt/lib
export PKG_CONFIG_PATH=/opt/share/pkgconfig:/opt/lib/pkgconfig

pushd "xkeyboard-config-$XKEYBOARD_CONFIG_VER"
./configure --prefix=/var/task
./configure --prefix=/opt
make -j$(nproc) && make install
popd

pushd "xorg-server-$XORG_VER"
./configure --prefix=/var/task --with-xkb-bin-directory=/tmp
./configure --prefix=/opt --with-xkb-bin-directory=/tmp
make -j$(nproc) && make install
popd

pushd "xkbcomp-$XKBCOMP_VER"
./configure --prefix=/var/task
./configure --prefix=/opt
make -j$(nproc) && make install
popd

cd /var/task
cd /opt

strip bin/*
find -name '*.so' -type f -print0 | xargs -0 strip
Expand All @@ -70,4 +70,4 @@ for lib in $(ldd $BINS_TO_LDD | grep -oP '^\s+\S+\s=>\s\K/(usr/)?lib\S+'); do
fi
done

tar jcf xvfb.tar.bz2 *
zip -r xvfb.zip *

0 comments on commit 5250fc3

Please sign in to comment.