Skip to content

Commit

Permalink
fix: sumamry should only run if no previous got cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
loispostula committed Mar 29, 2024
1 parent 6874377 commit 776d716
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/update_pre_commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Update Pre Commit Repo
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
generate_release_workflows:
uses: ForesightMiningSoftwareCorporation/github/.github/workflows/update_pre_commit.yml@v2
secrets: inherit
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
default_stages:
- pre-commit
- pre-push
fail_fast: true
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.2
hooks:
- id: gitleaks
- repo: https://github.com/mpalmer/action-validator
rev: v0.6.0
hooks:
- id: action-validator
- repo: https://github.com/ForesightMiningSoftwareCorporation/pre-commit
rev: v1.0.2
hooks:
- id: cargo-fmt
- id: cargo-check
- id: cargo-clippy
- id: cargo-lock
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-fslabscli"
version = "1.1.10"
version = "1.1.11"
edition = "2021"
authors = ["FSLABS DevOps Gods"]
repository = "https://github.com/ForesightMiningSoftwareCorporation/fslabsci"
Expand Down
4 changes: 2 additions & 2 deletions src/commands/generate_workflow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ echo "//npm.pkg.github.com/:_authToken=${{{{ secrets.NPM_{github_secret_key}_TOK
}
let mut member_keys: Vec<String> = members.0.keys().cloned().collect();
member_keys.sort();
let base_if = "always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')".to_string();
let mut actual_tests: Vec<String> = vec![];
for member_key in member_keys {
let Some(member) = members.0.get(&member_key) else {
Expand Down Expand Up @@ -601,7 +602,6 @@ echo "//npm.pkg.github.com/:_authToken=${{{{ secrets.NPM_{github_secret_key}_TOK
if !member.test_detail.skip.unwrap_or(false) && !split_workflows {
publish_needs.push(test_job_key.clone());
}
let base_if = "always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')".to_string();
let mut publish_if = format!("{} && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish))", base_if);
let mut test_if = base_if.clone();
if !options.no_check_changed_and_publish {
Expand Down Expand Up @@ -817,7 +817,7 @@ echo "//npm.pkg.github.com/:_authToken=${{{{ secrets.NPM_{github_secret_key}_TOK
// Add Tests Reporting
test_workflow.jobs.insert("test_results".to_string(), GithubWorkflowJob {
name: Some("Tests Results".to_string()),
job_if: Some("always()".to_string()),
job_if: Some("always() && !contains(needs.*.result, 'cancelled')".to_string()),
uses: Some(
format!(
"ForesightMiningSoftwareCorporation/github/.github/workflows/check_summaries.yml@{}",
Expand Down

0 comments on commit 776d716

Please sign in to comment.