mirror of
https://github.com/urbit/shrub.git
synced 2025-01-04 18:43:46 +03:00
Merge pull request #6210 from urbit/philip/ci
ci: Download runtime for unit tests
This commit is contained in:
commit
65c1a6bf04
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -16,6 +16,7 @@ on:
|
|||||||
- 'bin/**'
|
- 'bin/**'
|
||||||
- 'nix/**'
|
- 'nix/**'
|
||||||
- 'default.nix'
|
- 'default.nix'
|
||||||
|
- 'vere-version'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/build.yml'
|
- '.github/workflows/build.yml'
|
||||||
@ -31,6 +32,7 @@ on:
|
|||||||
- 'bin/**'
|
- 'bin/**'
|
||||||
- 'nix/**'
|
- 'nix/**'
|
||||||
- 'default.nix'
|
- 'default.nix'
|
||||||
|
- 'vere-version'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
call-vere:
|
call-vere:
|
||||||
|
121
.github/workflows/vere.yml
vendored
121
.github/workflows/vere.yml
vendored
@ -51,8 +51,6 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- { os: ubuntu-latest, type: linux }
|
- { os: ubuntu-latest, type: linux }
|
||||||
- { os: macos-latest, type: macos }
|
|
||||||
- { os: buildjet-4vcpu-ubuntu-2204-arm, type: linux }
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
@ -76,122 +74,13 @@ jobs:
|
|||||||
name: ares
|
name: ares
|
||||||
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
||||||
|
|
||||||
# run unit tests early on linux (x-compilation will skip them)
|
|
||||||
- name: build dynamic binary (and run tests)
|
|
||||||
if: ${{ matrix.type == 'linux' }}
|
|
||||||
run: nix-build -A urbit
|
|
||||||
|
|
||||||
- name: build static binary
|
|
||||||
run: |
|
|
||||||
nix-build -A urbit \
|
|
||||||
--arg enableStatic true \
|
|
||||||
--argstr verePace ${{ env.VERE_PACE }} > ./urbit-derivation
|
|
||||||
cat ./urbit-derivation
|
|
||||||
echo -n "urbit_static=" >> $GITHUB_ENV
|
|
||||||
cat ./urbit-derivation >> $GITHUB_ENV
|
|
||||||
cat ./urbit-derivation
|
|
||||||
|
|
||||||
- name: confirm binary is mostly static
|
|
||||||
if: matrix.type == 'macos'
|
|
||||||
run: |
|
|
||||||
bin="${{ env.urbit_static }}/bin/urbit"
|
|
||||||
|
|
||||||
if [ ! -f "$bin" ]; then
|
|
||||||
echo "no binary at $bin"
|
|
||||||
exit 1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
libs="$(otool -L "${{ env.urbit_static }}/bin/urbit" | tail -n +2)"
|
|
||||||
|
|
||||||
# XX CoreFoundation?
|
|
||||||
if [ -z "$(echo "$libs" | grep -v libSystem)" ]; then
|
|
||||||
echo "it's mostly static"
|
|
||||||
echo "$libs"
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo "dynamic links found:"
|
|
||||||
echo "$libs"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: get version string
|
|
||||||
run: |
|
|
||||||
if [ "real" == "$VERSION_TYPE" ]; then
|
|
||||||
version="$(cat ./pkg/urbit/version)"
|
|
||||||
else
|
|
||||||
version="${GITHUB_SHA:0:9}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -n "$version" > ./version-string
|
|
||||||
|
|
||||||
- name: upload version string artifact
|
|
||||||
if: matrix.type == 'linux'
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: version-string
|
|
||||||
path: version-string
|
|
||||||
|
|
||||||
- uses: google-github-actions/auth@v1
|
|
||||||
with:
|
|
||||||
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
|
|
||||||
|
|
||||||
- uses: google-github-actions/setup-gcloud@v1
|
|
||||||
if: inputs.upload
|
|
||||||
with:
|
|
||||||
project_id: ${{ secrets.GCS_PROJECT }}
|
|
||||||
|
|
||||||
- name: upload binary to bootstrap.urbit.org
|
|
||||||
if: inputs.upload
|
|
||||||
run: |
|
|
||||||
version="$(cat ./version-string)"
|
|
||||||
system="$(nix-instantiate --eval --expr 'builtins.currentSystem')"
|
|
||||||
system=${system:1:${#system}-2}
|
|
||||||
target="gs://${UPLOAD_BASE}/${VERE_PACE}/${version}/vere-v${version}-${system}"
|
|
||||||
|
|
||||||
gsutil cp -n "${{ env.urbit_static }}/bin/urbit" "$target"
|
|
||||||
exitcode=$?
|
|
||||||
|
|
||||||
test $exitcode -eq 0 &&
|
|
||||||
echo "upload to $target complete." ||
|
|
||||||
echo "upload to $target failed.";
|
|
||||||
exit $exitcode
|
|
||||||
|
|
||||||
- if: ${{ matrix.os == 'ubuntu-latest' }}
|
- if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||||
name: run urbit-tests
|
name: run urbit-tests
|
||||||
run: |
|
run: |
|
||||||
cp -RL tests pkg/arvo/tests
|
cp -RL tests pkg/arvo/tests
|
||||||
|
vere="$(cat ./vere-version | sed -e 's/\([^ ]*\) \([^ ]*\)/\1\/\2\/vere-\2/g' | tr -d '\n')"
|
||||||
|
url="$(echo https://bootstrap.urbit.org/vere/${vere}-linux-x86_64)"
|
||||||
|
# put in .jam so it doesn't crash when it gets -A'd in
|
||||||
|
curl -Lo pkg/arvo/vere.jam "$url"
|
||||||
|
chmod +x pkg/arvo/vere.jam
|
||||||
nix-build -A urbit-tests
|
nix-build -A urbit-tests
|
||||||
|
|
||||||
- if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
||||||
run: nix-build -A docker-image
|
|
||||||
|
|
||||||
after:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [urbit]
|
|
||||||
if: inputs.upload
|
|
||||||
steps:
|
|
||||||
- uses: google-github-actions/setup-gcloud@v0.2.0
|
|
||||||
with:
|
|
||||||
version: '290.0.1'
|
|
||||||
service_account_key: ${{ secrets.GCS_SERVICE_ACCOUNT_KEY }}
|
|
||||||
project_id: ${{ secrets.GCS_PROJECT }}
|
|
||||||
export_default_credentials: true
|
|
||||||
|
|
||||||
- name: download version-string
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: version-string
|
|
||||||
|
|
||||||
- name: update latest deployed version
|
|
||||||
run: |
|
|
||||||
target="gs://${UPLOAD_BASE}/${VERE_PACE}/last"
|
|
||||||
|
|
||||||
# *not* -n, as we want to overwrite the latest version-string
|
|
||||||
#
|
|
||||||
gsutil cp ./version-string "$target"
|
|
||||||
exitcode=$?
|
|
||||||
|
|
||||||
test $exitcode -eq 0 &&
|
|
||||||
echo "upload to $target complete." ||
|
|
||||||
echo "upload to $target failed.";
|
|
||||||
exit $exitcode
|
|
||||||
|
@ -100,8 +100,6 @@ let
|
|||||||
|
|
||||||
marsSources = callPackage ./nix/pkgs/marsSources { };
|
marsSources = callPackage ./nix/pkgs/marsSources { };
|
||||||
|
|
||||||
urbit = callPackage ./nix/pkgs/urbit { inherit enableStatic verePace; };
|
|
||||||
|
|
||||||
urcrypt = callPackage ./nix/pkgs/urcrypt { inherit enableStatic; };
|
urcrypt = callPackage ./nix/pkgs/urcrypt { inherit enableStatic; };
|
||||||
|
|
||||||
docker-image = callPackage ./nix/pkgs/docker-image { };
|
docker-image = callPackage ./nix/pkgs/docker-image { };
|
||||||
@ -112,11 +110,9 @@ let
|
|||||||
# Expose packages with local customisations (like patches) for dev access.
|
# Expose packages with local customisations (like patches) for dev access.
|
||||||
inherit (pkgsStatic) libsigsegv lmdb;
|
inherit (pkgsStatic) libsigsegv lmdb;
|
||||||
|
|
||||||
urbit-debug = urbit.override { enableDebug = true; };
|
|
||||||
urbit-tests = libLocal.testFakeShip {
|
urbit-tests = libLocal.testFakeShip {
|
||||||
inherit arvo;
|
inherit arvo;
|
||||||
|
|
||||||
urbit = urbit-debug;
|
|
||||||
pill = solid.lfs;
|
pill = solid.lfs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ lib, stdenvNoCC, curl }:
|
{ lib, stdenvNoCC, curl }:
|
||||||
|
|
||||||
{ urbit, arvo ? null, pill, ship, arguments ? [ "-l" ] }:
|
{ arvo ? null, pill, ship, arguments ? [ "-l" ] }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -10,14 +10,14 @@ let
|
|||||||
in stdenvNoCC.mkDerivation {
|
in stdenvNoCC.mkDerivation {
|
||||||
name = "fake-${ship}";
|
name = "fake-${ship}";
|
||||||
|
|
||||||
buildInputs = [ curl urbit ];
|
buildInputs = [ curl ];
|
||||||
|
|
||||||
phases = [ "buildPhase" "installPhase " ];
|
phases = [ "buildPhase" "installPhase " ];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
set -xeuo pipefail
|
set -xeuo pipefail
|
||||||
|
|
||||||
urbit ${lib.concatStringsSep " " args} ./pier
|
${arvo}/vere.jam ${lib.concatStringsSep " " args} ./pier
|
||||||
|
|
||||||
cleanup () {
|
cleanup () {
|
||||||
if [ -f ./pier/.vere.lock ]; then
|
if [ -f ./pier/.vere.lock ]; then
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
{ lib, stdenvNoCC, curl, python3, bootFakeShip }:
|
{ lib, stdenvNoCC, curl, python3, bootFakeShip }:
|
||||||
|
|
||||||
{ urbit, arvo ? null, pill, ship ? "bus", arguments ? urbit.meta.arguments
|
{ arvo ? null, pill, ship ? "bus", doCheck ? true }:
|
||||||
, doCheck ? true }:
|
|
||||||
|
|
||||||
stdenvNoCC.mkDerivation {
|
stdenvNoCC.mkDerivation {
|
||||||
name = "test-${ship}";
|
name = "test-${ship}";
|
||||||
|
|
||||||
src = bootFakeShip { inherit urbit arvo pill ship; };
|
src = bootFakeShip { inherit arvo pill ship; };
|
||||||
|
|
||||||
phases = [ "unpackPhase" "buildPhase" "checkPhase" ];
|
phases = [ "unpackPhase" "buildPhase" "checkPhase" ];
|
||||||
|
|
||||||
buildInputs = [ curl python3 urbit ];
|
buildInputs = [ curl python3 ];
|
||||||
|
|
||||||
unpackPhase = ''
|
unpackPhase = ''
|
||||||
cp -R $src ./pier
|
cp -R $src ./pier
|
||||||
@ -20,7 +19,7 @@ stdenvNoCC.mkDerivation {
|
|||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
urbit ${lib.concatStringsSep " " arguments} -d ./pier 2> urbit-output
|
${arvo}/vere.jam -d ./pier 2> urbit-output
|
||||||
|
|
||||||
# Sledge Hammer!
|
# Sledge Hammer!
|
||||||
# See: https://github.com/travis-ci/travis-ci/issues/4704#issuecomment-348435959
|
# See: https://github.com/travis-ci/travis-ci/issues/4704#issuecomment-348435959
|
||||||
|
1
vere-version
Normal file
1
vere-version
Normal file
@ -0,0 +1 @@
|
|||||||
|
edge v1.17-1429d53
|
Loading…
Reference in New Issue
Block a user