mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
d2dfac64b1
## Issue being fixed or feature implemented see warnings in https://github.com/dashpay/dash/actions/runs/5462770856 ## What was done? https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ ## How Has This Been Tested? n/a ## Breaking Changes n/a ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
70 lines
2.2 KiB
YAML
70 lines
2.2 KiB
YAML
name: Guix Build
|
|
|
|
on:
|
|
pull_request:
|
|
types: [ labeled ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: self-hosted
|
|
if: contains(github.event.pull_request.labels.*.name, 'guix-build')
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Commit variables
|
|
id: dockerfile
|
|
run: |
|
|
echo "hash=$(sha256sum ./contrib/containers/guix/Dockerfile | cut -d ' ' -f1)" >> $GITHUB_OUTPUT
|
|
echo "host_user_id=$(id -u)" >> $GITHUB_OUTPUT
|
|
echo "host_group_id=$(id -g)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Cache Docker layers
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: /tmp/.buildx-cache
|
|
key: ${{ runner.os }}-buildx-${{ steps.dockerfile.outputs.hash }}
|
|
restore-keys: |
|
|
${{ runner.os }}-buildx-
|
|
|
|
- name: Build Docker image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: ${{ github.workspace }}
|
|
build-args: |
|
|
USER_ID=${{ steps.dockerfile.outputs.host_user_id }}
|
|
GROUP_ID=${{ steps.dockerfile.outputs.host_group_id }}
|
|
build-contexts: |
|
|
docker_root=${{ github.workspace }}/contrib/containers/guix
|
|
file: ./contrib/containers/guix/Dockerfile
|
|
load: true
|
|
tags: guix_ubuntu:latest
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
|
|
- name: Run Guix build
|
|
run: |
|
|
docker run --privileged -d --rm -t \
|
|
--name guix-daemon \
|
|
-e ADDITIONAL_GUIX_COMMON_FLAGS="--max-jobs=$(nproc --all)" \
|
|
-v ${{ github.workspace }}:/src/dash \
|
|
-w /src/dash \
|
|
guix_ubuntu:latest && \
|
|
docker exec guix-daemon bash -c '/usr/local/bin/guix-start'
|
|
|
|
- name: Ensure build passes
|
|
run: |
|
|
if [[ $? != 0 ]]; then
|
|
echo "Guix build failed!"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Compute SHA256 checksums
|
|
run: |
|
|
./contrib/containers/guix/scripts/guix-check ${{ github.workspace }}
|