Skip to content

Ci experiments

Ci experiments #37

Workflow file for this run

name: CI
on:
pull_request:
merge_group:
push:
branches:
- master
- prod
- testnet
- acceptance-test-pass
jobs:
complete:
if: always()
needs: [fmt, cargo-deny, rust-check-git-rev-deps, build]
runs-on: namespace-profile-jammy-32-stellar-core
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
fmt:
runs-on: namespace-profile-jammy-32-stellar-core
steps:
- uses: actions/checkout@v4
- run: rustup component add rustfmt
- run: rustup update
- run: cargo fmt --all --check
cargo-deny:
runs-on: namespace-profile-jammy-32-stellar-core
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: actions/checkout@v4
- 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-32-stellar-core
steps:
- uses: actions/checkout@v4
- uses: stellar/actions/rust-check-git-rev-deps@main
build:
runs-on: namespace-profile-jammy-32-stellar-core
env:
CACHED_PATHS: |
~/.ccache
~/.cargo
target
strategy:
fail-fast: false
matrix:
toolchain: [ "gcc", "clang"]
protocol: ["current", "next"]
scenario: ["", "--check-test-tx-meta"]
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: ${{ env.CACHED_PATHS }}
- 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 }} ${{ matrix.scenario }}