Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reuse build artifacts in slowtest.yml #2253

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ concurrency:
env:
RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std"'
RUST_LOG: info,libp2p=off,node=error
CARGO_TERM_COLOR: always
DOCKER_PLATFORMS: ${{ github.event_name == 'pull_request' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}

jobs:
build:
runs-on: ubuntu-latest
runs-on: buildjet-8vcpu-ubuntu-2204
steps:
- uses: rui314/setup-mold@v1

- name: Fix submodule permissions check
run: |
git config --global --add safe.directory '*'
Expand All @@ -47,6 +50,7 @@ jobs:
uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-rust
cache-provider: buildjet

- name: Build
# Build in release without `testing` feature, this should work without `hotshot_example` config.
Expand Down
51 changes: 31 additions & 20 deletions .github/workflows/slowtest.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
name: Slow Test

on:
push:
branches:
- main
- release-*
tags:
# YYYYMMDD
- "20[0-9][0-9][0-1][0-9][0-3][0-9]*"
schedule:
- cron: "0 0 * * 1"
pull_request:
workflow_dispatch:
workflow_run:
workflows: [Build]
types:
- completed

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -46,19 +39,37 @@ jobs:
- name: Configure Environment
run: PATH="$PWD/target/release:$PATH"

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
- name: 'Download bins'
uses: actions/github-script@v7
with:
cache-all-crates: true
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "x86_64-unknown-linux-gnu-services"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/x86_64-unknown-linux-gnu-services.zip`, Buffer.from(download.data));

- name: Build
run: |
cargo build --locked --bin diff-test --release
cargo nextest run --locked --release --workspace --all-features --no-run
timeout-minutes: 90
- name: Unzip artifact
run: unzip -v x86_64-unknown-linux-gnu-services.zip

- name: debug
run: ls

- name: Slow Test
env:
NEXTEST_PROFILE: slow
run: cargo nextest run --locked --release --workspace --all-features --verbose --no-fail-fast --nocapture
run: |
cargo nextest run --locked --release --workspace --all-features --verbose --no-fail-fast \
--nocapture --workspace-remap $PWD
timeout-minutes: 40