Skip to content

Commit

Permalink
Fix some things in workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilospanck committed May 29, 2023
1 parent c470984 commit fce9443
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
check:
name: Check
if: ${{ startsWith(github.ref, 'refs/tags/') }}
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:

clippy:
name: Clippy
if: ${{ startsWith(github.ref, 'refs/tags/') }}
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
deploy:
name: Deploy packages
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
tests:
name: Run Tests
if: ${{ startsWith(github.ref, 'refs/tags/') }}
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
env:
PROJECT_NAME_UNDERSCORE: nostr
CARGO_INCREMENTAL: 0
Expand All @@ -20,10 +20,13 @@ jobs:
matrix:
rust:
- nightly
directories:
- ./relay
- ./client
- ./nostr-sdk
package:
- directory: ./relay
name: relay
- directory: ./client
name: client
- directory: ./nostr-sdk
name: nostr-sdk

steps:
# Checkout repository
Expand All @@ -40,7 +43,7 @@ jobs:

# Build
- name: Build
working-directory: ${{ matrix.directories }}
working-directory: ${{ matrix.package.directory }}
run: cargo build $CARGO_OPTIONS

# Cache
Expand All @@ -53,30 +56,30 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: test-${{ runner.os }}-cargo-${{ matrix.rust }}-project-${{ matrix.directories }}-${{ hashFiles('**/Cargo.lock') }}
key: test-${{ runner.os }}-cargo-${{ matrix.rust }}-project-${{ matrix.package.directory }}-${{ hashFiles('**/Cargo.lock') }}

# Tests
- name: Run tests
working-directory: ${{ matrix.directories }}
working-directory: ${{ matrix.package.directory }}
run: |
cargo test --tests
cargo test --doc
# Coverage
##! CARGO_INCREMENTAL, RUSTFLAGS, RUSTDOCFLAGS - added to CARGO_OPTIONS in cargo test needed for code coverage
- name: Generate test result and coverage report
working-directory: ${{ matrix.directories }}
working-directory: ${{ matrix.package.directory }}
run: |
find . -name '*.gcda' -delete
cargo install grcov --force;
cargo test $CARGO_OPTIONS --tests;
zip -0 ccov.zip `find . \( -name "$PROJECT_NAME_UNDERSCORE*.gc*" \) -print`;
grcov ccov.zip -s . -t lcov --llvm --ignore-not-existing --ignore "/*" -o lcov.info;
grcov ccov.zip -s . -t lcov --llvm --ignore-not-existing --ignore "/*" -o ${{ matrix.package.name }}.info;
cat ${{ matrix.package.name }}.info >> final_coverage.info
# Upload to CodeCov
- name: Upload to CodeCov
uses: codecov/codecov-action@v3
with:
working-directory: ${{ matrix.directories }}
files: ./lcov.info
files: ./final_coverage.info
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion relay/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
compile-to-x86_64-unknown-linux-gnu:
cross build --release --target x86_64-unknown-linux-gnu -v
cross build --release --target x86_64-unknown-linux-gnu

build-release-mode:
cargo build --release
Expand Down

0 comments on commit fce9443

Please sign in to comment.