-
Notifications
You must be signed in to change notification settings - Fork 13
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
CI improve nightly GHA workflow #761
Changes from 5 commits
a723cce
79c9c70
bae53e0
3a59317
6eed02a
b02761d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Prepare polkadot and staking-miner-playground binaries | ||
|
||
This action downloads the Polkadot and Staking miner binaries produced from workflows | ||
`build-polkadot-for-nightly.yml` and `build-staking-miner-playground-for-nightly.yml` and puts them into the `$PATH`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Prepare polkadot and staking-miner-playground binaries | ||
description: Downloads and configures prebuilt Polkadot and Staking Miner Playground binaries | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Download polkadot binaries | ||
uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d # v3.0.0 | ||
with: | ||
workflow: build-polkadot-for-nightly.yml | ||
name: nightly-polkadot-binary | ||
path: ./tmp | ||
|
||
- name: Download staking-miner-playground binary | ||
uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d # v3.0.0 | ||
with: | ||
workflow: build-staking-miner-playground-for-nightly.yml | ||
name: staking-miner-playground-binary | ||
path: ./tmp | ||
|
||
- name: Setup permissions and move to path | ||
shell: bash | ||
run: | | ||
chmod u+x ./tmp/polkadot* ./tmp/staking-miner-playground | ||
./tmp/polkadot --version | ||
./tmp/staking-miner-playground --version | ||
mkdir -p ~/.local/bin | ||
mv ./tmp/polkadot* ~/.local/bin | ||
mv ./tmp/staking-miner-playground ~/.local/bin |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Build polkadot binary for nightly tests | ||
|
||
on: | ||
# Allow it to be manually ran to rebuild binary when needed: | ||
workflow_dispatch: {} | ||
# Run at 22pm every day for nightly builds. | ||
schedule: | ||
- cron: "0 22 * * *" | ||
|
||
jobs: | ||
tests: | ||
name: Build polkadot binary | ||
runs-on: ubuntu-latest | ||
container: paritytech/ci-unified:bullseye-1.74.0-2023-11-01-v20231204 | ||
steps: | ||
- name: checkout polkadot-sdk | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: paritytech/polkadot-sdk | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
workspaces: | | ||
polkadot | ||
cache-on-failure: true | ||
|
||
- name: build polkadot binary | ||
run: | | ||
cargo build -p polkadot --release --features fast-runtime | ||
./target/release/polkadot --version | ||
|
||
- name: upload polkadot binary | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: nightly-polkadot-binary | ||
path: | | ||
./target/release/polkadot | ||
./target/release/polkadot-execute-worker | ||
./target/release/polkadot-prepare-worker | ||
retention-days: 2 | ||
if-no-files-found: error |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Build staking miner playground binary for nightly tests | ||
|
||
on: | ||
# Run when changes to staking miner playground is made | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'staking-miner-playground/**' | ||
# Allow it to be manually ran to rebuild binary when needed: | ||
workflow_dispatch: {} | ||
# Run at 22pm every week on Sunday's for nightly builds. | ||
schedule: | ||
- cron: "0 22 * * 6" | ||
|
||
jobs: | ||
tests: | ||
name: Build staking-miner-playground | ||
runs-on: ubuntu-latest | ||
container: paritytech/ci-unified:bullseye-1.74.0-2023-11-01-v20231204 | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
workspaces: | | ||
staking-miner-playground | ||
cache-on-failure: true | ||
|
||
- name: build staking-miner-playground binary | ||
run: | | ||
cd staking-miner-playground | ||
cargo build --release --features test-trimming | ||
./target/release/staking-miner-playground --version | ||
|
||
- name: upload staking-miner-playground binary | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: staking-miner-playground-binary | ||
path: ./staking-miner-playground/target/release/staking-miner-playground | ||
retention-days: 8 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you could increase retention-rate to something like 30 days because the staking-miner playground hasn't been changed for a long time. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. Let it be 31, and binary will be rebuild on 1st day of every month :) |
||
if-no-files-found: error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍