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

Update GH actions for master and prs #365

Merged
merged 1 commit into from
Sep 1, 2023
Merged
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
18 changes: 12 additions & 6 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:
check:
name: Check
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
feature: [libp2p, waku]
Comment on lines +14 to +17
Copy link
Contributor

@youngjoon-lee youngjoon-lee Sep 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the fail-fast: true doesn't work because we have the continue-on-error: true for the cargo check step below, probably?
For example, the cargo check failed in the PR: https://github.com/logos-co/nomos-node/actions/runs/6046982217/job/16409567703?pr=316, but it show me the green light.

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fail-fast: true is set for master branch. PRs has a separate file prs.yml and it's set to fail-fast: false. But I'll update the cargo check step to continue-on-error: false

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, i left this comment at the wrong position :)) but it seems the pr.yml also has the same settings.

steps:
- uses: actions/checkout@v2
with:
Expand All @@ -24,13 +28,13 @@ jobs:
continue-on-error: true
with:
command: check
args: --all --no-default-features --features ${{ matrix.feature }}

test:
name: Test Suite
strategy:
fail-fast: false # all OSes should be tested even if one fails (default: true)
matrix:
os: [ubuntu-latest, windows-latest] # macos-latest removed because 1 min on macos is x10 on GH runtime.
feature: [libp2p, waku]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand All @@ -48,16 +52,18 @@ jobs:
continue-on-error: true
with:
command: build
args: --all-features
args: --all --no-default-features --features ${{ matrix.feature }}
- uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: test
args: --all-features
args: --all --no-default-features --features ${{ matrix.feature }}

lints:
name: Rust lints
runs-on: ubuntu-latest
matrix:
feature: [libp2p, waku]
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -81,4 +87,4 @@ jobs:
continue-on-error: true
with:
command: clippy
args: -- --deny warnings
args: --all --no-default-features --features ${{ matrix.feature }} -- --deny warnings
94 changes: 94 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# copy of https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
# Steps for checking PRs.
on:
pull_request:
branches:
- "*"

name: PR check

jobs:
check:
name: Check
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
feature: [libp2p, waku]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: check
args: --all --no-default-features --features ${{ matrix.feature }}

test:
name: Test Suite
if: ${{ !startsWith(github.event.pull_request.title, '[WIP]') && !contains(github.event.label.name, 'DO NOT MERGE') }}
strategy:
fail-fast: false # all OSes should be tested even if one fails (default: true)
matrix:
feature: [libp2p, waku]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-go@v3 # we need go to build go-waku
with:
go-version: '1.19'
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: build
args: --all --no-default-features --features ${{ matrix.feature }}
- uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: test
args: --all --no-default-features --features ${{ matrix.feature }}

lints:
name: Rust lints
runs-on: ubuntu-latest
strategy:
matrix:
feature: [libp2p, waku]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: clippy
args: --all --no-default-features --features ${{ matrix.feature }} -- --deny warnings
Loading