Skip to content

Commit 8e6ad3a

Browse files
michaelsproulWoodpile37
authored andcommitted
Various CI fixes (sigp#3813)
## Issue Addressed Closes sigp#3812 Closes sigp#3750 Closes sigp#3705
1 parent 81ebabb commit 8e6ad3a

5 files changed

Lines changed: 51 additions & 37 deletions

File tree

.github/workflows/local-testnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Get latest version of stable Rust
2222
run: rustup update stable
2323
- name: Install Protoc
24-
uses: arduino/setup-protoc@v1
24+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
2525
with:
2626
repo-token: ${{ secrets.GITHUB_TOKEN }}
2727
- name: Install ganache

.github/workflows/release.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
env:
99
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
1010
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
11-
REPO_NAME: sigp/lighthouse
12-
IMAGE_NAME: sigp/lighthouse
11+
REPO_NAME: ${{ github.repository_owner }}/lighthouse
12+
IMAGE_NAME: ${{ github.repository_owner }}/lighthouse
1313

1414
jobs:
1515
extract-version:
@@ -63,12 +63,8 @@ jobs:
6363
steps:
6464
- name: Checkout sources
6565
uses: actions/checkout@v3
66-
- name: Build toolchain
67-
uses: actions-rs/toolchain@v1
68-
with:
69-
toolchain: stable
70-
profile: minimal
71-
override: true
66+
- name: Get latest version of stable Rust
67+
run: rustup update stable
7268

7369
# ==============================
7470
# Windows dependencies
@@ -88,7 +84,7 @@ jobs:
8884
# ==============================
8985
- name: Install Protoc
9086
if: contains(matrix.arch, 'darwin') || contains(matrix.arch, 'windows')
91-
uses: arduino/setup-protoc@v1
87+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
9288
with:
9389
repo-token: ${{ secrets.GITHUB_TOKEN }}
9490

@@ -179,13 +175,13 @@ jobs:
179175
# =======================================================================
180176

181177
- name: Upload artifact
182-
uses: actions/upload-artifact@v2
178+
uses: actions/upload-artifact@v3
183179
with:
184180
name: lighthouse-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz
185181
path: lighthouse-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz
186182

187183
- name: Upload signature
188-
uses: actions/upload-artifact@v2
184+
uses: actions/upload-artifact@v3
189185
with:
190186
name: lighthouse-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz.asc
191187
path: lighthouse-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz.asc
@@ -208,19 +204,22 @@ jobs:
208204
# ==============================
209205

210206
- name: Download artifacts
211-
uses: actions/download-artifact@v2
207+
uses: actions/download-artifact@v3
212208

213209
# ==============================
214210
# Create release draft
215211
# ==============================
216212

217213
- name: Generate Full Changelog
218214
id: changelog
219-
run: echo "CHANGELOG=$(git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 ${{ env.VERSION }}^)..${{ env.VERSION }})" >> $GITHUB_OUTPUT
215+
run: |
216+
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
217+
echo "$(git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 ${{ env.VERSION }}^)..${{ env.VERSION }})" >> $GITHUB_OUTPUT
218+
echo "EOF" >> $GITHUB_OUTPUT
220219
221220
- name: Create Release Draft
222221
env:
223-
GITHUB_USER: sigp
222+
GITHUB_USER: ${{ github.repository_owner }}
224223
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
225224

226225
# The formatting here is borrowed from OpenEthereum: https://github.com/openethereum/openethereum/blob/main/.github/workflows/build.yml

.github/workflows/test-suite.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ env:
1313
RUSTFLAGS: "-D warnings"
1414
# The Nightly version used for cargo-udeps, might need updating from time to time.
1515
PINNED_NIGHTLY: nightly-2022-05-20
16+
# Prevent Github API rate limiting.
17+
LIGHTHOUSE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1618
jobs:
1719
target-branch-check:
1820
name: target-branch-check
@@ -51,7 +53,7 @@ jobs:
5153
- name: Get latest version of stable Rust
5254
run: rustup update stable
5355
- name: Install Protoc
54-
uses: arduino/setup-protoc@v1
56+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
5557
with:
5658
repo-token: ${{ secrets.GITHUB_TOKEN }}
5759
- name: Install ganache
@@ -95,7 +97,7 @@ jobs:
9597
- name: Get latest version of stable Rust
9698
run: rustup update stable
9799
- name: Install Protoc
98-
uses: arduino/setup-protoc@v1
100+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
99101
with:
100102
repo-token: ${{ secrets.GITHUB_TOKEN }}
101103
- name: Run beacon_chain tests for all known forks
@@ -109,7 +111,7 @@ jobs:
109111
- name: Get latest version of stable Rust
110112
run: rustup update stable
111113
- name: Install Protoc
112-
uses: arduino/setup-protoc@v1
114+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
113115
with:
114116
repo-token: ${{ secrets.GITHUB_TOKEN }}
115117
- name: Run operation_pool tests for all known forks
@@ -133,7 +135,7 @@ jobs:
133135
- name: Get latest version of stable Rust
134136
run: rustup update stable
135137
- name: Install Protoc
136-
uses: arduino/setup-protoc@v1
138+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
137139
with:
138140
repo-token: ${{ secrets.GITHUB_TOKEN }}
139141
- name: Install ganache
@@ -149,7 +151,7 @@ jobs:
149151
- name: Get latest version of stable Rust
150152
run: rustup update stable
151153
- name: Install Protoc
152-
uses: arduino/setup-protoc@v1
154+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
153155
with:
154156
repo-token: ${{ secrets.GITHUB_TOKEN }}
155157
- name: Run state_transition_vectors in release.
@@ -163,7 +165,7 @@ jobs:
163165
- name: Get latest version of stable Rust
164166
run: rustup update stable
165167
- name: Install Protoc
166-
uses: arduino/setup-protoc@v1
168+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
167169
with:
168170
repo-token: ${{ secrets.GITHUB_TOKEN }}
169171
- name: Run consensus-spec-tests with blst, milagro and fake_crypto
@@ -189,7 +191,7 @@ jobs:
189191
- name: Get latest version of stable Rust
190192
run: rustup update stable
191193
- name: Install Protoc
192-
uses: arduino/setup-protoc@v1
194+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
193195
with:
194196
repo-token: ${{ secrets.GITHUB_TOKEN }}
195197
- name: Install ganache
@@ -205,7 +207,7 @@ jobs:
205207
- name: Get latest version of stable Rust
206208
run: rustup update stable
207209
- name: Install Protoc
208-
uses: arduino/setup-protoc@v1
210+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
209211
with:
210212
repo-token: ${{ secrets.GITHUB_TOKEN }}
211213
- name: Install ganache
@@ -221,7 +223,7 @@ jobs:
221223
- name: Get latest version of stable Rust
222224
run: rustup update stable
223225
- name: Install Protoc
224-
uses: arduino/setup-protoc@v1
226+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
225227
with:
226228
repo-token: ${{ secrets.GITHUB_TOKEN }}
227229
- name: Install ganache
@@ -237,7 +239,7 @@ jobs:
237239
- name: Get latest version of stable Rust
238240
run: rustup update stable
239241
- name: Install Protoc
240-
uses: arduino/setup-protoc@v1
242+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
241243
with:
242244
repo-token: ${{ secrets.GITHUB_TOKEN }}
243245
- name: Install ganache
@@ -253,7 +255,7 @@ jobs:
253255
- name: Get latest version of stable Rust
254256
run: rustup update stable
255257
- name: Install Protoc
256-
uses: arduino/setup-protoc@v1
258+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
257259
with:
258260
repo-token: ${{ secrets.GITHUB_TOKEN }}
259261
- name: Install ganache
@@ -285,7 +287,7 @@ jobs:
285287
- name: Get latest version of stable Rust
286288
run: rustup update stable
287289
- name: Install Protoc
288-
uses: arduino/setup-protoc@v1
290+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
289291
with:
290292
repo-token: ${{ secrets.GITHUB_TOKEN }}
291293
- name: Run exec engine integration tests in release
@@ -299,7 +301,7 @@ jobs:
299301
- name: Get latest version of stable Rust
300302
run: rustup update stable
301303
- name: Install Protoc
302-
uses: arduino/setup-protoc@v1
304+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
303305
with:
304306
repo-token: ${{ secrets.GITHUB_TOKEN }}
305307
- name: Typecheck benchmark code without running it
@@ -323,7 +325,7 @@ jobs:
323325
- name: Get latest version of stable Rust
324326
run: rustup update stable
325327
- name: Install Protoc
326-
uses: arduino/setup-protoc@v1
328+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
327329
with:
328330
repo-token: ${{ secrets.GITHUB_TOKEN }}
329331
- name: Lint code for quality and style with Clippy
@@ -346,7 +348,7 @@ jobs:
346348
cargo build --release --bin cargo-clippy --bin clippy-driver
347349
cargo build --release --bin cargo-clippy --bin clippy-driver -Zunstable-options --out-dir $(rustc --print=sysroot)/bin
348350
- name: Install Protoc
349-
uses: arduino/setup-protoc@v1
351+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
350352
with:
351353
repo-token: ${{ secrets.GITHUB_TOKEN }}
352354
- name: Run Clippy with the disallowed-from-async lint
@@ -360,7 +362,7 @@ jobs:
360362
- name: Install Rust @ MSRV (${{ needs.extract-msrv.outputs.MSRV }})
361363
run: rustup override set ${{ needs.extract-msrv.outputs.MSRV }}
362364
- name: Install Protoc
363-
uses: arduino/setup-protoc@v1
365+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
364366
with:
365367
repo-token: ${{ secrets.GITHUB_TOKEN }}
366368
- name: Run cargo check
@@ -404,7 +406,7 @@ jobs:
404406
# NOTE: cargo-udeps version is pinned until this issue is resolved:
405407
# https://github.com/est31/cargo-udeps/issues/135
406408
- name: Install Protoc
407-
uses: arduino/setup-protoc@v1
409+
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
408410
with:
409411
repo-token: ${{ secrets.GITHUB_TOKEN }}
410412
- name: Install cargo-udeps

testing/ef_tests/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ BLS_TARBALL = $(patsubst %,%-$(BLS_TEST_TAG).tar.gz,$(BLS_TEST))
1313
BLS_OUTPUT_DIR := $(OUTPUT_DIR)/$(BLS_TEST_REPO_NAME)
1414
BLS_BASE_URL := https://github.com/ethereum/$(BLS_TEST_REPO_NAME)/releases/download/$(BLS_TEST_TAG)
1515

16+
WGET := $(if $(LIGHTHOUSE_GITHUB_TOKEN),wget --header="Authorization: $(LIGHTHOUSE_GITHUB_TOKEN)",wget)
17+
1618
all:
1719
make $(OUTPUT_DIR)
1820
make $(BLS_OUTPUT_DIR)
@@ -25,11 +27,11 @@ $(OUTPUT_DIR): $(TARBALLS)
2527

2628
$(BLS_OUTPUT_DIR):
2729
mkdir $(BLS_OUTPUT_DIR)
28-
wget $(BLS_BASE_URL)/$(BLS_TEST).tar.gz -O $(BLS_TARBALL)
30+
$(WGET) $(BLS_BASE_URL)/$(BLS_TEST).tar.gz -O $(BLS_TARBALL)
2931
tar -xzf $(BLS_TARBALL) -C $(BLS_OUTPUT_DIR)
3032

3133
%-$(TESTS_TAG).tar.gz:
32-
wget $(BASE_URL)/$*.tar.gz -O $@
34+
$(WGET) $(BASE_URL)/$*.tar.gz -O $@
3335

3436
clean-test-files:
3537
rm -rf $(OUTPUT_DIR) $(BLS_OUTPUT_DIR)

testing/web3signer_tests/build.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
//! This build script downloads the latest Web3Signer release and places it in the `OUT_DIR` so it
22
//! can be used for integration testing.
33
4-
use reqwest::Client;
4+
use reqwest::{
5+
header::{self, HeaderValue},
6+
Client,
7+
};
58
use serde_json::Value;
69
use std::env;
710
use std::fs;
@@ -15,10 +18,15 @@ const FIXED_VERSION_STRING: Option<&str> = None;
1518
#[tokio::main]
1619
async fn main() {
1720
let out_dir = env::var("OUT_DIR").unwrap();
18-
download_binary(out_dir.into()).await;
21+
22+
// Read a Github API token from the environment. This is intended to prevent rate-limits on CI.
23+
// We use a name that is unlikely to accidentally collide with anything the user has configured.
24+
let github_token = env::var("LIGHTHOUSE_GITHUB_TOKEN");
25+
26+
download_binary(out_dir.into(), github_token.as_deref().unwrap_or("")).await;
1927
}
2028

21-
pub async fn download_binary(dest_dir: PathBuf) {
29+
pub async fn download_binary(dest_dir: PathBuf, github_token: &str) {
2230
let version_file = dest_dir.join("version");
2331

2432
let client = Client::builder()
@@ -33,8 +41,11 @@ pub async fn download_binary(dest_dir: PathBuf) {
3341
env_version
3442
} else {
3543
// Get the latest release of the web3 signer repo.
44+
let mut token_header_value = HeaderValue::from_str(github_token).unwrap();
45+
token_header_value.set_sensitive(true);
3646
let latest_response: Value = client
3747
.get("https://api.github.com/repos/ConsenSys/web3signer/releases/latest")
48+
.header(header::AUTHORIZATION, token_header_value)
3849
.send()
3950
.await
4051
.unwrap()

0 commit comments

Comments
 (0)