Skip to content

Commit

Permalink
test cache
Browse files Browse the repository at this point in the history
  • Loading branch information
plowsof committed Oct 7, 2024
1 parent f29a8da commit 710f4ee
Showing 1 changed file with 25 additions and 32 deletions.
57 changes: 25 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,6 @@ jobs:
- uses: actions/checkout@v1
with:
submodules: recursive
- uses: jpribyl/[email protected]
if: "!startsWith(github.ref, 'refs/tags/v')"
continue-on-error: true
with:
key: docker-linux-static-{hash}
restore-keys: |
docker-linux-static-
- name: install dependencies
run: sudo apt -y install xvfb libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xkb1 libxcb-shape0 libxkbcommon-x11-0
- name: free up diskspace
Expand All @@ -128,34 +121,34 @@ jobs:
# run: docker build --target checkaptdebs --tag monero:checkaptdebs --file Dockerfile.linux .
#- name: Verify Packages / pinned debs' md5sums
# run: docker build --target verifypackages --tag monero:verifypackages --file Dockerfile.linux .
- name: prepare build environment
run: docker build --tag monero:build-env-linux --build-arg THREADS=3 --file Dockerfile.linux .
- name: build 1st
run: docker run --rm -v /home/runner/work/monero-gui/monero-gui:/monero-gui -w /monero-gui monero:build-env-linux sh -c 'make release-static -j3 CXXFLAGS="-ffile-prefix-map=/monero-gui=."'
- name: Clean Build Directory
run: |
docker run --rm \
-v /home/runner/work/monero-gui/monero-gui:/monero-gui:noatime \
-w monero:build-env-linux \
sh -c 'make clean'
- name: Move
run: mv /home/runner/work/monero-gui/monero-gui/build/release/bin/monero-wallet-gui build1-monero-wallet-gui
- name: Calculate shared_functions.sh hash
id: shared_functions_hash
run: echo "hash=$(sha256sum shared_functions.sh | awk '{ print $1 }')" >> $GITHUB_OUTPUT

- name: build 2nd
run: docker run --rm -v /home/runner/work/monero-gui/monero-gui:/monero-gui -w /monero-gui monero:build-env-linux sh -c 'make release-static -j3 CXXFLAGS="-ffile-prefix-map=/monero-gui=."'

- name: Compare Builds with Diffoscope
run: |
sudo apt-get update && sudo apt-get install -y diffoscope
diffoscope --html-dir diffoscope-report build1-monero-wallet-gui /home/runner/work/monero-gui/monero-gui/build/release/bin/monero-wallet-gui
- name: Archive Diffoscope Report
uses: actions/upload-artifact@v4
- uses: actions/cache@v3
id: docker_cache
with:
name: diffoscope-report
path: diffoscope-report
path: /tmp/docker-image
key: ${{ runner.os }}-docker-${{ steps.shared_functions_hash.outputs.hash }}

- name: Load cached Docker image
if: steps.docker_cache.outputs.cache-hit == 'true'
run: docker load -i /tmp/docker-image/image.tar
- name: Build Docker image
run: |
if [[ "$(docker images -q monero:build-env-linux 2> /dev/null)" == "" ]]; then
echo "Building new image..."
docker build --tag monero:build-env-linux --build-arg SHARED_FUNCTIONS_HASH=${{ steps.shared_functions_hash.outputs.hash }} --file Dockerfile.linux .
else
echo "Using cached image..."
fi
- name: Save Docker image to cache
if: steps.docker_cache.outputs.cache-hit != 'true'
run: |
mkdir -p /tmp/docker-image
docker save monero:build-env-linux > /tmp/docker-image/image.tar
- name: build
run: docker run --rm -v /home/runner/work/monero-gui/monero-gui:/monero-gui -w /monero-gui monero:build-env-linux sh -c 'make release-static -j3 CXXFLAGS="-ffile-prefix-map=/monero-gui=."'
- name: sha256sum
run: shasum -a256 /home/runner/work/monero-gui/monero-gui/build/release/bin/monero-wallet-gui
- name: test qml
Expand Down

0 comments on commit 710f4ee

Please sign in to comment.