Skip to content

Commit

Permalink
test: ignore comments, restore some actions
Browse files Browse the repository at this point in the history
  • Loading branch information
voznik committed Jun 4, 2024
1 parent 84f455c commit 404d117
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 25 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,25 @@ jobs:
- name: Install cargo-llvm-cov and nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov,nextest
tool: cargo-llvm-cov,nextest,cargo-codspeed

- name: Generate code coverage
env:
NEXTEST_PROFILE: coverage # defined in .config/nextest.toml
run: cargo llvm-cov nextest --all-features --workspace --lcov --output-path lcov.info

# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v4
# with:
# fail_ci_if_error: false
# files: lcov.info
# token: ${{ secrets.CODECOV_TOKEN }}
- name: Coveralls
if: ${{ success() }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.info

- name: Build the benchmark target(s)
run: cargo codspeed build

- name: Run the benchmarks
uses: CodSpeedHQ/action@v2
with:
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}
18 changes: 17 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ jobs:
components: llvm-tools-preview
targets: ${{ matrix.target }}

- name: Install cargo-sonar
uses: taiki-e/install-action@v2
with:
tool: cargo-sonar

- uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -88,4 +93,15 @@ jobs:
if: matrix.target != 'x86_64-pc-windows-msvc'

- name: cargo clippy
run: cargo clippy --workspace -- -D warnings
run: |
cargo clippy --workspace --message-format json > clippy-report.json
cargo sonar --clippy --clippy-path clippy-report.json
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: -Dsonar.externalIssuesReportPaths=sonar-issues.json
# -Dcommunity.rust.lcov.reportPaths=.coverage/lcov.info
35 changes: 18 additions & 17 deletions .github/workflows/package-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ jobs:
daemon_release_name: ralertsinuad-linux-x86_64
cross: true
strip: true
env:
CARGO_NO_DFEALT_FEATURES: 1
CARGO_FEATURE_CACHE: 1
CARGO_FEATURE_REQWEST_RUSTLS_TLS: 1
OPENSSL_LIB_DIR: /usr/lib
OPENSSL_INCLUDE_DIR: /usr/include
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
client_artifact_name: target/aarch64-unknown-linux-musl/release/ralertsinua
Expand All @@ -51,6 +57,12 @@ jobs:
daemon_release_name: ralertsinuad-linux-armv7
cross: true
strip: false
env:
CARGO_NO_DFEALT_FEATURES: 1
CARGO_FEATURE_CACHE: 1
CARGO_FEATURE_REQWEST_RUSTLS_TLS: 1
OPENSSL_LIB_DIR: /usr/lib
OPENSSL_INCLUDE_DIR: /usr/include
- os: ubuntu-latest
target: arm-unknown-linux-musleabihf
client_artifact_name: target/arm-unknown-linux-musleabihf/release/ralertsinua
Expand All @@ -59,6 +71,12 @@ jobs:
daemon_release_name: ralertsinuad-linux-arm
cross: true
strip: false
env:
CARGO_NO_DFEALT_FEATURES: 1
CARGO_FEATURE_CACHE: 1
CARGO_FEATURE_REQWEST_RUSTLS_TLS: 1
OPENSSL_LIB_DIR: /usr/lib
OPENSSL_INCLUDE_DIR: /usr/include
- os: windows-latest
target: x86_64-pc-windows-msvc
client_artifact_name: target/x86_64-pc-windows-msvc/release/ralertsinua.exe
Expand Down Expand Up @@ -109,14 +127,6 @@ jobs:
strip: ${{ matrix.strip }}
if: matrix.target != 'x86_64-pc-windows-msvc'

- name: Compress daemon
uses: svenstaro/upx-action@v2
with:
file: ${{ matrix.daemon_artifact_name }}
args: --lzma
strip: ${{ matrix.strip }}
if: matrix.target != 'x86_64-pc-windows-msvc'

- name: Upload client binaries to release
uses: svenstaro/upload-release-action@v2
with:
Expand All @@ -126,15 +136,6 @@ jobs:
tag: ${{ github.ref }}
overwrite: true

- name: Upload daemon binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.daemon_artifact_name }}
asset_name: ${{ matrix.daemon_release_name }}
tag: ${{ github.ref }}
overwrite: true

- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pre-build = [
dpkg --add-architecture $CROSS_DEB_ARCH && \
apt-get update && \
apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH
export OPENSSL_LIB_DIR=/usr/lib
echo OPENSSL_LIB_DIR=$OPENSSL_LIB_DIR
"""
]
Expand All @@ -26,6 +27,7 @@ pre-build = [
dpkg --add-architecture $CROSS_DEB_ARCH && \
apt-get update && \
apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH
export OPENSSL_LIB_DIR=/usr/lib
echo OPENSSL_LIB_DIR=$OPENSSL_LIB_DIR
"""
]
Expand All @@ -37,6 +39,7 @@ pre-build = [
dpkg --add-architecture $CROSS_DEB_ARCH && \
apt-get update && \
apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH
export OPENSSL_LIB_DIR=/usr/lib
echo OPENSSL_LIB_DIR=$OPENSSL_LIB_DIR
"""
]
1 change: 1 addition & 0 deletions ralertsinua-geo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub mod location;
pub mod utils;

#[derive(thiserror::Error, Debug)]
// coveralls-ignore-next-line
pub enum GeoError {
#[error("Unknown error Geo")]
Unknown,
Expand Down
2 changes: 2 additions & 0 deletions ralertsinua-http/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ pub struct AlertsInUaClient {
}

impl std::fmt::Debug for AlertsInUaClient {
// coveralls-ignore-start
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "AlertsInUaClient {{ base_url: {}, token: {}, client: {:?}, meta_data: {:?}, cache_manager: {:?} }}", self.base_url, self.token, self.client, self.meta_data, "CACacheManager")
}
// coveralls-ignore-stop
}

impl AlertsInUaClient {
Expand Down
1 change: 1 addition & 0 deletions ralertsinua-http/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
/// ```
#[derive(thiserror::Error, miette::Diagnostic, Debug)]
#[diagnostic(code(ralertsinua_http::client))]
// coveralls-ignore-next-line
pub enum ApiError {
/// The request couldn't be completed because there was an error when trying
/// to do so
Expand Down
1 change: 1 addition & 0 deletions ralertsinua-models/src/air_raid_alert_oblast_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub struct AirRaidAlertOblastStatus {
status: AlertStatus,
}

// coveralls-ignore-next-line
impl fmt::Display for AirRaidAlertOblastStatus {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
use strum::EnumProperty;
Expand Down
2 changes: 2 additions & 0 deletions ralertsinua-models/src/alert_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use serde::{Deserialize, Serialize};
strum_macros::AsRefStr,
strum_macros::Display,
)]
// coveralls-ignore-next-line
pub enum AlertStatus {
/// Active
#[strum(to_string = "Active", props(icon = "🜸", color = "red"))] // 🔴
Expand All @@ -31,6 +32,7 @@ pub enum AlertStatus {
O,
}

// coveralls-ignore-next-line
impl From<char> for AlertStatus {
fn from(c: char) -> Self {
match c {
Expand Down
1 change: 1 addition & 0 deletions ralertsinua-models/src/alert_type.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#[derive(
Debug, Default, Clone, strum_macros::Display, strum_macros::EnumString, PartialEq,
)]
// coveralls-ignore-next-line
pub enum AlertType {
#[default]
#[strum(to_string = "air_raid")]
Expand Down
1 change: 1 addition & 0 deletions ralertsinua-models/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use thiserror::Error;

/// Groups up the kinds of errors that may happen in this crate.
#[derive(Debug, Error)]
// coveralls-ignore-next-line
pub enum ModelError {
#[error("json parse error: {0}")]
ParseJson(#[from] serde_json::Error),
Expand Down
1 change: 1 addition & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::action::*;
/// Groups up the kinds of errors that may happen in this crate.
#[derive(Error, Diagnostic, Debug)]
#[error("ralertsinua error!")]
// coveralls-ignore-next-line
pub enum AppError {
#[error("input/output error: {0}")]
Io(#[from] std::io::Error),
Expand Down

0 comments on commit 404d117

Please sign in to comment.