Skip to content

Commit 77f2cae

Browse files
committed
try a new namespace profile and caching
1 parent 7f7771f commit 77f2cae

File tree

1 file changed

+15
-61
lines changed

1 file changed

+15
-61
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ jobs:
1515
complete:
1616
if: always()
1717
needs: [fmt, cargo-deny, rust-check-git-rev-deps, build]
18-
runs-on: namespace-profile-default
18+
runs-on: jammy-32-stellar-core
1919
steps:
2020
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
2121
run: exit 1
2222

2323
fmt:
24-
runs-on: namespace-profile-default
24+
runs-on: jammy-32-stellar-core
2525
steps:
2626
- uses: actions/checkout@v4
2727
- run: rustup component add rustfmt
2828
- run: rustup update
2929
- run: cargo fmt --all --check
3030

3131
cargo-deny:
32-
runs-on: namespace-profile-default
32+
runs-on: jammy-32-stellar-core
3333
strategy:
3434
matrix:
3535
checks:
@@ -47,13 +47,13 @@ jobs:
4747
arguments:
4848

4949
rust-check-git-rev-deps:
50-
runs-on: namespace-profile-default
50+
runs-on: jammy-32-stellar-core
5151
steps:
5252
- uses: actions/checkout@v4
5353
- uses: stellar/actions/rust-check-git-rev-deps@main
5454

5555
build:
56-
runs-on: namespace-profile-default
56+
runs-on: jammy-32-stellar-core
5757
env:
5858
CACHED_PATHS: |
5959
~/.ccache
@@ -72,66 +72,27 @@ jobs:
7272
# using leading to random crashes: https://reviews.llvm.org/D148280
7373
run: sudo sysctl vm.mmap_rnd_bits=28
7474

75-
# We start with as cheap as possible a cache probe to see if we have an exact hit on this
76-
# git commit ID (for a given OS/toolchain/protocol). If so we can skip all subsequent
77-
# steps: we already tested this exact SHA.
78-
#
79-
# Unfortunately due to the way github actions control flow works, we have to repeat the
80-
# step 'if' condition in each step, and cannot actually "exit early" and skip the job.
81-
# There are a lot of duplicate bug reports filed on this aspect of github actions, don't
82-
# bother filing another.
83-
- name: Probe Cache
84-
id: cache
85-
uses: actions/cache/restore@v4
75+
- name: Checkout with Namespace Git mirrors cache
76+
uses: namespacelabs/nscloud-checkout-action@v7
8677
with:
87-
path: ${{ env.CACHED_PATHS }}
88-
key: ${{ runner.os }}-${{ matrix.toolchain }}-${{ matrix.protocol }}-${{ github.sha }}
89-
lookup-only: true
78+
fetch-depth: 1
79+
submodules: recursive
9080

91-
# When we have a cache miss on the exact commit SHA, we restore from the prefix without it.
92-
# This will restore the most-recently-written cache (github does this date ordering itself).
93-
- name: Restore Cache
94-
if: steps.cache.outputs.cache-hit != 'true'
95-
uses: actions/cache/restore@v4
81+
- name: Configure Namespace cache volume
82+
uses: namespacelabs/nscloud-cache-action@v1
9683
with:
9784
path: ${{ env.CACHED_PATHS }}
98-
key: ${{ steps.cache.outputs.cache-primary-key }}
99-
restore-keys: |
100-
${{ runner.os }}-${{ matrix.toolchain }}-${{ matrix.protocol }}
101-
102-
- uses: actions/checkout@v4
103-
if: steps.cache.outputs.cache-hit != 'true'
104-
with:
105-
fetch-depth: 200
106-
submodules: true
107-
- name: install core packages
108-
if: steps.cache.outputs.cache-hit != 'true'
109-
run: |
110-
sudo apt-get update
111-
sudo apt-get -y install --no-install-recommends apt-utils dialog git iproute2 procps lsb-release
112-
- name: install tool chain
113-
if: steps.cache.outputs.cache-hit != 'true'
114-
run: |
115-
sudo apt-get -y install libstdc++-10-dev clang-format-12 ccache lldb
116-
if test "${{ matrix.toolchain }}" = "gcc" ; then
117-
sudo apt-get -y install cpp-10 gcc-10 g++-10
118-
else
119-
sudo apt-get -y install clang-12 llvm-12
120-
fi
85+
12186
- name: install rustup components
122-
if: steps.cache.outputs.cache-hit != 'true'
12387
run: rustup component add rustfmt
88+
12489
- name: install cargo-cache
125-
if: steps.cache.outputs.cache-hit != 'true'
12690
run: cargo install --locked cargo-cache --version 0.8.3
91+
12792
- name: install cargo-sweep
128-
if: steps.cache.outputs.cache-hit != 'true'
12993
run: cargo install --locked cargo-sweep --version 0.7.0
130-
- name: install dependencies
131-
if: steps.cache.outputs.cache-hit != 'true'
132-
run: sudo apt-get -y install postgresql git build-essential pkg-config autoconf automake libtool bison flex libpq-dev parallel libunwind-dev sed perl
94+
13395
- name: Build
134-
if: steps.cache.outputs.cache-hit != 'true'
13596
run: |
13697
if test "${{ matrix.toolchain }}" = "gcc" ; then
13798
export CC='gcc'
@@ -142,10 +103,3 @@ jobs:
142103
fi
143104
echo Build with $CC and $CXX
144105
./ci-build.sh --use-temp-db --protocol ${{ matrix.protocol }} ${{ matrix.scenario }}
145-
146-
# We only _save_ to the cache when we had a cache miss, are running on master, and are the non-txmeta scenario.
147-
- uses: actions/cache/save@v4
148-
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.ref_name == 'master' && matrix.scenario == ''}}
149-
with:
150-
path: ${{ env.CACHED_PATHS }}
151-
key: ${{ steps.cache.outputs.cache-primary-key }}

0 commit comments

Comments
 (0)