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

yaml test 2 #167

Open
wants to merge 11 commits into
base: trigger
Choose a base branch
from
Open
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
47 changes: 29 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ concurrency:
run-name: ${{ inputs.tag }}

jobs:
pre:
pre_job:
name: Workflow Check
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
paths_result: ${{ steps.skip_check.outputs.paths_result }}
should_skip: ${{ steps.workflow_check.outputs.should_skip }}
paths_result: ${{ steps.workflow_check.outputs.paths_result }}
steps:
- name: skip-duplicate-actions
id: workflow_check
Expand All @@ -98,7 +98,6 @@ jobs:
- '.cargo/**'
- 'contrib/core-contract-tests/**'
- 'net-test/**'
- '.github/workflows/**'
- '.github/actions/**'
- '**.sh' ## for testing
paths_ignore:
Expand All @@ -107,6 +106,7 @@ jobs:
- '**.txt'
- '**.toml'
- '**.in'
# - '.github/workflows/**'

##
## Jobs to execute everytime workflow runs
Expand All @@ -117,20 +117,30 @@ jobs:
## - PR change is requested
rustfmt:
if: |
(
needs.pre.outputs.should_skip != 'true' ||
!fromJSON(needs.pre.outputs.paths_result).rustfmt.should_skip
) ||
!(
github.event_name == 'pull_request_review' &&
github.event.action == 'submitted' &&
(
github.event.review.state == 'commented' ||
github.event.review.state == 'changes_requested'
)
needs.pre_job.outputs.should_skip == 'true' ||
fromJSON(needs.pre_job.outputs.paths_result).rustfmt.should_skip == 'true'
)
# if: needs.pre_job.outputs.should_skip == 'true' || fromJSON(needs.pre_job.outputs.paths_result).rustfmt.should_skip == 'true'
# if: |
# (
# needs.pre_job.outputs.should_skip != 'true' ||
# fromJSON(needs.pre_job.outputs.paths_result).rustfmt.should_skip
# )
# (
# needs.pre_job.outputs.should_skip == 'true' ||
# fromJSON(needs.pre_job.outputs.paths_result).rustfmt.should_skip
# ) ||
# !(
# github.event_name == 'pull_request_review' &&
# github.event.action == 'submitted' &&
# (
# github.event.review.state == 'commented' ||
# github.event.review.state == 'changes_requested'
# )
# )
name: Rust Format
needs: pre
needs: pre_job
runs-on: ubuntu-latest
steps:
- name: Echo
Expand All @@ -139,9 +149,10 @@ jobs:
echo "ci test"
echo "github.event_name: ${{ github.event_name }}"
echo "github.event.action: ${{ github.event.action }}"
echo "github.event: ${{ github.event }}"
echo "needs.pre.outputs.should_skip: ${{ needs.pre_job.outputs.should_skip }}"
echo "needs.pre.outputs.paths_result: ${{ needs.pre_job.outputs.paths_result }}"
echo "github.event.review.state: ${{ github.event.review.state }}"
echo "GLOBAL: needs.pre.outputs.should_skip: ${{ needs.pre_job.outputs.should_skip }}"
echo "PATHS_RESULT: needs.pre.outputs.paths_result: ${{ needs.pre_job.outputs.paths_result }}"
echo "PATHS_RESULT: fromJSON(needs.pre_job.outputs.paths_result).rustfmt.should_skip: ${{ fromJSON(needs.pre_job.outputs.paths_result).rustfmt.should_skip }}"

#################################################################
## double commented below
Expand Down
1 change: 1 addition & 0 deletions test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ lines:
- line 15
- line 15
- line 15
- line 16