Skip to content

Commit

Permalink
go back
Browse files Browse the repository at this point in the history
  • Loading branch information
PastaPastaPasta committed Aug 9, 2024
1 parent 04ff838 commit 0801492
Showing 1 changed file with 43 additions and 29 deletions.
72 changes: 43 additions & 29 deletions .github/workflows/guix-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ jobs:
guix_build:
needs: build-image
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ needs.build-image.outputs.repo-name }}/dashcore-guix-builder:${{ needs.build-image.outputs.image-tag }}
options: --user root
volumes:
- ${{ github.workspace }}/dash:/src/dash"
- ${{ github.workspace }}/.cache:/home/ubuntu/.cache
# container:
# image: ghcr.io/${{ needs.build-image.outputs.repo-name }}/dashcore-guix-builder:${{ needs.build-image.outputs.image-tag }}
# options: --user root
# volumes:
# - ${{ github.workspace }}/dash:/src/dash"
# - ${{ github.workspace }}/.cache:/home/ubuntu/.cache

strategy:
matrix:
Expand Down Expand Up @@ -98,42 +98,53 @@ jobs:
${{ runner.os }}-guix-${{ matrix.build_target }}
${{ runner.os }}-guix-
# - name: Create .cache folder if missing
# if: steps.guix-cache-restore.outputs.cache-hit != 'true'
# run: mkdir -p ${{ github.workspace }}/.cache
- name: Create .cache folder if missing
if: steps.guix-cache-restore.outputs.cache-hit != 'true'
run: mkdir -p ${{ github.workspace }}/.cache
run: mkdir -p .cache

- name: Start Guix Processes
working-directory: ${{ github.workspace }}
run: |
/usr/local/bin/entrypoint

# - name: Start Guix Container
# timeout-minutes: 480
# - name: Start Guix Processes
# working-directory: ${{ github.workspace }}
# run: |
# docker run --privileged -d --rm -t \
# --name guix-daemon \
# -e ADDITIONAL_GUIX_COMMON_FLAGS="--max-jobs=$(nproc --all)" \
# -v ${{ github.workspace }}/dash:/src/dash \
# -v ${{ github.workspace }}/.cache:/home/ubuntu/.cache \
# -w /src/dash \
# ghcr.io/${{ steps.prepare.outputs.repo-name }}/dashcore-guix-builder:${{ steps.prepare.outputs.image-tag }}
# /usr/local/bin/entrypoint

- name: Start Guix Container
timeout-minutes: 480
run: |
docker run --privileged -d --rm -t \
--name guix-daemon \
-e ADDITIONAL_GUIX_COMMON_FLAGS="--max-jobs=$(nproc --all)" \
-v ${{ github.workspace }}/dash:/src/dash \
-v ${{ github.workspace }}/.cache:/home/ubuntu/.cache \
-w /src/dash \
ghcr.io/${{ steps.prepare.outputs.repo-name }}/dashcore-guix-builder:${{ steps.prepare.outputs.image-tag }}
# - name: Restore Guix Archive
# working-directory: ${{ github.workspace }}
# run: |
# if [ -f ${{ github.workspace }}/.cache/guix-archive.nar ]; then
# /usr/local/bin/guix-restore-cache
# else
# echo "Guix archive file not found, skipping import."
# fi
# shell: bash
- name: Restore Guix Archive
working-directory: ${{ github.workspace }}
run: |
if [ -f ${{ github.workspace }}/.cache/guix-archive.nar ]; then
/usr/local/bin/guix-restore-cache
if [ -f ~/.cache/guix-archive.nar ]; then
docker exec guix-daemon bash -c '/usr/local/bin/guix-restore-cache'
else
echo "Guix archive file not found, skipping import."
fi
shell: bash

- name: Run Guix Build
continue-on-error: true
working-directory: ${{ github.workspace }}
run: |
HOSTS=${{ matrix.build_target }} timeout 60 /usr/local/bin/guix-start
# HOSTS=${{ matrix.build_target }} timeout 60 /usr/local/bin/guix-start
docker exec guix-daemon bash -c 'HOSTS=${{ matrix.build_target }} timeout 60 /usr/local/bin/guix-start'

- name: Ensure build passes
run: |
Expand All @@ -144,11 +155,14 @@ jobs:
shell: bash


# - name: Call Guix Archive
# working-directory: ${{ github.workspace }}
# run: |
# /usr/local/bin/guix-save-cache ${{ github.workspace }}
# shell: bash
- name: Call Guix Archive
working-directory: ${{ github.workspace }}
run: |
/usr/local/bin/guix-save-cache ${{ github.workspace }}
shell: bash
docker exec guix-daemon bash -c '/usr/local/bin/guix-save-cache'
- name: Compute SHA256 checksums
Expand Down

0 comments on commit 0801492

Please sign in to comment.