Skip to content

Namespace runners

Namespace runners #95

Workflow file for this run

name: CI
on:
pull_request:
merge_group:
push:
branches:
- master
- prod
- testnet
- acceptance-test-pass
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
complete:
if: always()
needs: [fmt, cargo-deny, rust-check-git-rev-deps, build-linux, build-mac]
runs-on:
- namespace-profile-jammy-1-stellar-core
- nscloud-cache-exp-do-not-commit
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
fmt:
runs-on:
- namespace-profile-jammy-1-stellar-core
- nscloud-cache-exp-do-not-commit
steps:
- uses: namespacelabs/nscloud-checkout-action@v7
with:
fetch-depth: 1
submodules: recursive
- run: rustup component add rustfmt
- run: rustup update
- run: cargo fmt --all --check
cargo-deny:
runs-on:
- namespace-profile-jammy-1-stellar-core
- nscloud-cache-exp-do-not-commit
strategy:
matrix:
checks:
- advisories
- bans licenses sources
# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: namespacelabs/nscloud-checkout-action@v7
with:
fetch-depth: 1
submodules: recursive
- uses: EmbarkStudios/cargo-deny-action@8d73959fce1cdc8989f23fdf03bec6ae6a6576ef
with:
command: check ${{ matrix.checks }}
# leave arguments empty so we don't test --all-features
# which will see conflicting env versions
arguments:
rust-check-git-rev-deps:
runs-on:
- namespace-profile-jammy-1-stellar-core
- nscloud-cache-exp-do-not-commit
steps:
- uses: namespacelabs/nscloud-checkout-action@v7
with:
fetch-depth: 1
submodules: recursive
- uses: stellar/actions/rust-check-git-rev-deps@main
build-linux:
runs-on:
- namespace-profile-jammy-32-stellar-core;overrides.cache-tag=config-${{ matrix.toolchain }}-${{ matrix.protocol }}
strategy:
fail-fast: false
matrix:
toolchain: [ "gcc", "clang"]
protocol: ["current", "next"]
steps:
- name: Fix kernel mmap rnd bits
# Asan in llvm provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
run: sudo sysctl vm.mmap_rnd_bits=28
- name: Checkout with Namespace Git mirrors cache
uses: namespacelabs/nscloud-checkout-action@v7
with:
fetch-depth: 1
submodules: recursive
- name: Configure Namespace cache volume
uses: namespacelabs/nscloud-cache-action@v1
with:
path: |
~/.cargo
build-${{matrix.toolchain}}-${{matrix.protocol}}
- name: install rustup
run: ./install-rust.sh
- name: install rustup components
run: rustup component add rustfmt
- name: install cargo-cache
run: cargo install --locked cargo-cache --version 0.8.3
- name: install cargo-sweep
run: cargo install --locked cargo-sweep --version 0.7.0
- name: Build
run: |
if test "${{ matrix.toolchain }}" = "gcc" ; then
export CC='gcc'
export CXX='g++'
else
export CC='clang'
export CXX='clang++'
fi
echo Build with $CC and $CXX
./ci-build.sh --use-temp-db --protocol ${{ matrix.protocol }}
build-mac:
runs-on:
- namespace-profile-macos-sequoia;overrides.cache-tag=config-macos-sequoia
steps:
- name: Checkout with Namespace Git mirrors cache
uses: namespacelabs/nscloud-checkout-action@v7
with:
fetch-depth: 1
submodules: recursive
- name: Configure Namespace cache volume
uses: namespacelabs/nscloud-cache-action@v1
with:
path: |
~/.cargo
build-clang-current
- name: install prerequisites and uninstall brew rust, add rustup
run: |
brew install libsodium libtool autoconf automake pkg-config libpq openssl parallel ccache bison gnu-sed perl coreutils
brew uninstall rust rustup
brew install rustup
- name: install rustup components
run: |
rustup-init -y
rustup component add rustfmt rustc cargo clippy rust-src rust-std
- name: install cargo-cache
run: |
cargo install --locked cargo-cache --version 0.8.3
- name: install cargo-sweep
run: |
cargo install --locked cargo-sweep --version 0.7.0
- name: Build
run: |
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix)/opt/libpq/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix)/opt/openssl@3/lib/pkgconfig"
export PATH="$(brew --prefix bison)/bin:$PATH"
export CC='clang'
export CXX='clang++'
export CLANG_VERSION=none
export SKIP_FORMAT_CHECK=1
./ci-build.sh --disable-postgres --protocol current