2020-11-11 10:48:53 +03:00
|
|
|
# Notes:
|
|
|
|
#
|
|
|
|
# jobs.<job_id>
|
|
|
|
#
|
|
|
|
# A seperate job id results in a lot of duplication of nix/cachix work.
|
|
|
|
# The build will have to download any substituted derivations from cachix
|
|
|
|
# for the steps with each distinct job id and upload built derivations to
|
|
|
|
# cachix after each job has completed, either succesfully or on failure.
|
|
|
|
#
|
|
|
|
# jobs.<job_id>.steps.run
|
|
|
|
#
|
|
|
|
# build + test are distinct as each step entry results in a collapsable title
|
|
|
|
# within the log output, which makes it easier to view failing builds or
|
|
|
|
# tests independently.
|
|
|
|
#
|
|
|
|
# jobs.<job_id>.strategy.fail-fast
|
|
|
|
#
|
|
|
|
# Set to false so developers working on vere or king-haskell can have their
|
|
|
|
# respective builds proceed without the other causing failure.
|
|
|
|
#
|
|
|
|
# shell.nix
|
|
|
|
#
|
|
|
|
# mkShell doesn't allow you to build it - so instantiate all the subshells
|
|
|
|
# defined for the individual pkg/*/shell.nix as a sanity check and to create
|
|
|
|
# some artefacts suitable for developers to pull from cachix. The top-level
|
|
|
|
# shell.nix build time is dominated by Haskell dependencies so it's built as
|
|
|
|
# part of the haskell build steps.
|
|
|
|
#
|
|
|
|
# Syntax:
|
|
|
|
#
|
|
|
|
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
|
|
|
|
|
2020-12-04 10:59:49 +03:00
|
|
|
name: build
|
2020-11-11 10:48:53 +03:00
|
|
|
|
2021-03-23 22:30:18 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
2021-03-29 21:42:15 +03:00
|
|
|
- 'pkg/arvo/**'
|
|
|
|
- 'pkg/docker-image/**'
|
|
|
|
- 'pkg/ent/**'
|
|
|
|
- 'pkg/ge-additions/**'
|
|
|
|
- 'pkg/libaes_siv/**'
|
|
|
|
- 'pkg/urbit/**'
|
2022-04-01 21:03:41 +03:00
|
|
|
- 'pkg/urcrypt/**'
|
2021-03-29 21:42:15 +03:00
|
|
|
- 'bin/**'
|
|
|
|
- 'nix/**'
|
2022-04-01 21:03:41 +03:00
|
|
|
- default.nix
|
2021-03-23 22:30:18 +03:00
|
|
|
pull_request:
|
|
|
|
paths:
|
2021-03-29 21:42:15 +03:00
|
|
|
- 'pkg/arvo/**'
|
|
|
|
- 'pkg/docker-image/**'
|
|
|
|
- 'pkg/ent/**'
|
|
|
|
- 'pkg/ge-additions/**'
|
|
|
|
- 'pkg/libaes_siv/**'
|
|
|
|
- 'pkg/urbit/**'
|
2022-04-01 21:03:41 +03:00
|
|
|
- 'pkg/urcrypt/**'
|
2021-03-29 21:42:15 +03:00
|
|
|
- 'bin/**'
|
|
|
|
- 'nix/**'
|
2022-04-01 21:03:41 +03:00
|
|
|
- default.nix
|
2022-05-21 00:05:33 +03:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
upload:
|
|
|
|
description: 'upload binaries to gcp'
|
|
|
|
default: false
|
|
|
|
required: false
|
|
|
|
type: boolean
|
|
|
|
|
|
|
|
env:
|
2022-05-21 07:02:14 +03:00
|
|
|
DO_UPLOAD: >
|
|
|
|
inputs.upload ||
|
|
|
|
(github.ref_name == 'next/vere' && github.ref_type == 'branch')
|
|
|
|
UPLOAD_BASE: bootstrap.urbit.org/ci/vere/often
|
2020-11-11 10:48:53 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
urbit:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- { os: ubuntu-latest }
|
|
|
|
- { os: macos-latest }
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-01-13 15:33:09 +03:00
|
|
|
|
|
|
|
# We only want the extra nix config on linux, where it is necessary
|
|
|
|
# for the docker build. We don't want in on Mac, where it isn't but
|
|
|
|
# it breaks the nix install. The two `if` clauses should be mutually
|
|
|
|
# exclusive
|
2021-12-08 12:03:12 +03:00
|
|
|
- uses: cachix/install-nix-action@v16
|
2021-01-13 15:33:09 +03:00
|
|
|
with:
|
|
|
|
extra_nix_config: |
|
|
|
|
system-features = nixos-test benchmark big-parallel kvm
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
2021-12-08 12:03:12 +03:00
|
|
|
- uses: cachix/install-nix-action@v16
|
2021-01-13 15:33:09 +03:00
|
|
|
if: ${{ matrix.os != 'ubuntu-latest' }}
|
|
|
|
|
2021-11-02 07:32:24 +03:00
|
|
|
- uses: cachix/cachix-action@v10
|
2020-11-11 10:48:53 +03:00
|
|
|
with:
|
2021-01-22 14:50:46 +03:00
|
|
|
name: ares
|
2020-11-11 10:48:53 +03:00
|
|
|
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
|
|
|
|
|
|
- run: nix-build -A urbit --arg enableStatic true
|
|
|
|
|
2022-05-21 00:05:33 +03:00
|
|
|
- uses: google-github-actions/setup-gcloud@v0.2.0
|
|
|
|
if: ${{ env.DO_UPLOAD == 'true' }}
|
|
|
|
with:
|
|
|
|
version: '290.0.1'
|
|
|
|
service_account_key: ${{ secrets.GCS_SERVICE_ACCOUNT_KEY }}
|
|
|
|
project_id: ${{ secrets.GCS_PROJECT }}
|
|
|
|
export_default_credentials: true
|
|
|
|
|
|
|
|
- name: upload binary to bootstrap.urbit.org
|
|
|
|
if: ${{ env.DO_UPLOAD == 'true' }}
|
|
|
|
# XX how to get the nix-store path from the previous step without "rebuilding" it?
|
|
|
|
run: |
|
|
|
|
result="$(nix-build -A urbit --arg enableStatic true)"
|
|
|
|
version="$(cat ./pkg/urbit/version)"
|
|
|
|
system="$(nix-instantiate --eval --expr 'builtins.currentSystem')"
|
|
|
|
system=${system:1:${#system}-2}
|
2022-05-21 07:02:14 +03:00
|
|
|
target="gs://${UPLOAD_BASE}/${GITHUB_SHA:0:9}/vere-v${version}-${system}"
|
2022-05-21 00:05:33 +03:00
|
|
|
|
|
|
|
gsutil cp -n $result/bin/urbit "$target"
|
|
|
|
exitcode=$?
|
|
|
|
|
|
|
|
test $exitcode -eq 0 &&
|
|
|
|
echo "upload to $target complete." ||
|
|
|
|
echo "upload to $target failed.";
|
|
|
|
exit $exitcode
|
|
|
|
|
2020-12-04 10:59:49 +03:00
|
|
|
- if: ${{ matrix.os == 'ubuntu-latest' }}
|
2020-11-11 10:48:53 +03:00
|
|
|
run: nix-build -A urbit-tests
|
|
|
|
|
2021-01-13 15:33:09 +03:00
|
|
|
- if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
|
|
run: nix-build -A docker-image
|
|
|
|
|
2021-03-29 23:49:41 +03:00
|
|
|
mingw:
|
|
|
|
runs-on: windows-latest
|
|
|
|
defaults:
|
|
|
|
run:
|
2022-05-21 07:02:14 +03:00
|
|
|
shell: >
|
|
|
|
C:\msys64\msys2_shell.cmd -mingw64 -defterm -no-start -here -c
|
|
|
|
". <(cygpath '{0}')"
|
2021-05-02 23:57:40 +03:00
|
|
|
working-directory: ./pkg/urbit
|
2021-03-29 23:49:41 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
lfs: true
|
|
|
|
|
|
|
|
# echo suppresses pacman prompt
|
2021-08-30 20:46:36 +03:00
|
|
|
- run: echo|./configure
|
2021-05-02 23:57:40 +03:00
|
|
|
env:
|
2021-08-07 03:38:56 +03:00
|
|
|
CACHIX_CACHE: ares
|
2021-05-02 23:57:40 +03:00
|
|
|
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
2021-03-29 23:49:41 +03:00
|
|
|
|
2022-04-10 05:46:25 +03:00
|
|
|
- run: mingw32-make build/urbit
|
2022-05-21 07:02:14 +03:00
|
|
|
- run: >
|
|
|
|
build/urbit -l -d -B ../../bin/solid.pill -F bus &&
|
|
|
|
curl -f --data '{"source":{"dojo":"+hood/exit"},"sink":{"app":"hood"}}'
|
|
|
|
http://localhost:12321
|
2022-05-21 00:14:46 +03:00
|
|
|
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
if: ${{ env.DO_UPLOAD == 'true' }}
|
|
|
|
with:
|
|
|
|
python-version: 3.7
|
|
|
|
|
|
|
|
- uses: google-github-actions/setup-gcloud@v0.6.0
|
|
|
|
if: ${{ env.DO_UPLOAD == 'true' }}
|
|
|
|
env:
|
|
|
|
# see https://github.com/google-github-actions/setup-gcloud/issues/100
|
|
|
|
CLOUDSDK_PYTHON: ${{env.pythonLocation}}\python.exe
|
|
|
|
with:
|
|
|
|
service_account_key: ${{ secrets.GCS_SERVICE_ACCOUNT_KEY }}
|
|
|
|
project_id: ${{ secrets.GCS_PROJECT }}
|
|
|
|
export_default_credentials: true
|
|
|
|
|
|
|
|
- name: upload binary to bootstrap.urbit.org
|
|
|
|
if: ${{ env.DO_UPLOAD == 'true' }}
|
|
|
|
env:
|
|
|
|
CLOUDSDK_PYTHON: ${{env.pythonLocation}}\python.exe
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
version="$(cat ./version)"
|
|
|
|
system="x86_64-windows"
|
2022-05-21 07:02:14 +03:00
|
|
|
target="gs://${UPLOAD_BASE}/${GITHUB_SHA:0:9}/vere-v${version}-${system}.exe"
|
2022-05-21 00:14:46 +03:00
|
|
|
|
|
|
|
gsutil cp -n ./build/urbit.exe "$target"
|
|
|
|
exitcode=$?
|
|
|
|
|
|
|
|
test $exitcode -eq 0 &&
|
|
|
|
echo "upload to $target complete." ||
|
|
|
|
echo "upload to $target failed.";
|
|
|
|
exit $exitcode
|