|
9 | 9 | build:
|
10 | 10 | runs-on: [ "self-hosted", "linux", "x64", "ubuntu-core" ]
|
11 | 11 | if: contains(github.event.pull_request.labels.*.name, 'guix-build')
|
| 12 | + timeout-minutes: 480 |
12 | 13 | steps:
|
13 | 14 | - name: Checkout
|
14 | 15 | uses: actions/checkout@v4
|
15 | 16 | with:
|
16 | 17 | ref: ${{ github.event.pull_request.head.sha }}
|
| 18 | + path: dash |
17 | 19 |
|
18 | 20 | - name: Set up Docker Buildx
|
19 | 21 | uses: docker/setup-buildx-action@v3
|
20 | 22 |
|
21 | 23 | - name: Commit variables
|
22 | 24 | id: dockerfile
|
23 | 25 | run: |
|
24 |
| - echo "hash=$(sha256sum ./contrib/containers/guix/Dockerfile | cut -d ' ' -f1)" >> $GITHUB_OUTPUT |
| 26 | + echo "hash=$(sha256sum ./dash/contrib/containers/guix/Dockerfile | cut -d ' ' -f1)" >> $GITHUB_OUTPUT |
25 | 27 | echo "host_user_id=$(id -u)" >> $GITHUB_OUTPUT
|
26 | 28 | echo "host_group_id=$(id -g)" >> $GITHUB_OUTPUT
|
27 | 29 |
|
28 | 30 | - name: Build Docker image
|
29 | 31 | uses: docker/build-push-action@v5
|
30 | 32 | with:
|
31 |
| - context: ${{ github.workspace }} |
| 33 | + context: ${{ github.workspace }}/dash |
32 | 34 | build-args: |
|
33 | 35 | USER_ID=${{ steps.dockerfile.outputs.host_user_id }}
|
34 | 36 | GROUP_ID=${{ steps.dockerfile.outputs.host_group_id }}
|
35 | 37 | build-contexts: |
|
36 |
| - docker_root=${{ github.workspace }}/contrib/containers/guix |
37 |
| - file: ./contrib/containers/guix/Dockerfile |
| 38 | + docker_root=${{ github.workspace }}/dash/contrib/containers/guix |
| 39 | + file: ./dash/contrib/containers/guix/Dockerfile |
38 | 40 | load: true
|
39 | 41 | tags: guix_ubuntu:latest
|
40 | 42 | cache-from: type=gha
|
41 | 43 | cache-to: type=gha,mode=max
|
42 | 44 |
|
| 45 | + - name: Restore Guix cache and depends |
| 46 | + id: guix-cache-restore |
| 47 | + uses: actions/cache/restore@v3 |
| 48 | + with: |
| 49 | + path: | |
| 50 | + ${{ github.workspace }}/.cache |
| 51 | + ${{ github.workspace }}/dash/depends/built |
| 52 | + ${{ github.workspace }}/dash/depends/sources |
| 53 | + ${{ github.workspace }}/dash/depends/work |
| 54 | + key: ${{ runner.os }}-guix |
| 55 | + |
| 56 | + - name: Create .cache folder if missing |
| 57 | + if: steps.guix-cache-restore.outputs.cache-hit != 'true' |
| 58 | + run: mkdir -p .cache |
| 59 | + |
43 | 60 | - name: Run Guix build
|
| 61 | + timeout-minutes: 480 |
44 | 62 | run: |
|
45 | 63 | docker run --privileged -d --rm -t \
|
46 | 64 | --name guix-daemon \
|
47 | 65 | -e ADDITIONAL_GUIX_COMMON_FLAGS="--max-jobs=$(nproc --all)" \
|
48 |
| - -v ${{ github.workspace }}:/src/dash \ |
| 66 | + -v ${{ github.workspace }}/dash:/src/dash \ |
| 67 | + -v ${{ github.workspace }}/.cache:/home/ubuntu/.cache \ |
49 | 68 | -w /src/dash \
|
50 | 69 | guix_ubuntu:latest && \
|
51 | 70 | docker exec guix-daemon bash -c '/usr/local/bin/guix-start'
|
|
57 | 76 | exit 1
|
58 | 77 | fi
|
59 | 78 |
|
| 79 | + - name: Save Guix cache and depends |
| 80 | + id: guix-cache-save |
| 81 | + uses: actions/cache/save@v3 |
| 82 | + with: |
| 83 | + path: | |
| 84 | + ${{ github.workspace }}/.cache |
| 85 | + ${{ github.workspace }}/dash/depends/built |
| 86 | + ${{ github.workspace }}/dash/depends/sources |
| 87 | + ${{ github.workspace }}/dash/depends/work |
| 88 | + key: ${{ steps.guix-cache-restore.outputs.cache-primary-key }} |
| 89 | + |
60 | 90 | - name: Compute SHA256 checksums
|
61 | 91 | run: |
|
62 |
| - ./contrib/containers/guix/scripts/guix-check ${{ github.workspace }} |
| 92 | + ./dash/contrib/containers/guix/scripts/guix-check ${{ github.workspace }}/dash |
0 commit comments