Skip to content

Commit

Permalink
feat: Split CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jaironalves committed Jul 12, 2024
1 parent d9b44a5 commit 5f346d1
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Continuous Integration
name: Continuous Integration - Docker

on:
pull_request:
Expand Down
37 changes: 32 additions & 5 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:

outputs:
comment-line: ${{ steps.action.outputs.test-action_comment-line }}
to-dont-read: ${{ steps.action.outputs.test-action_to-dont-read }}
multiline: ${{ steps.action.outputs.test-action_multiline }}
steps:
- name: Checkout
Expand All @@ -30,6 +31,12 @@ jobs:
uses: ./
with:
file-path: ./yq-test-action.yml
filtering-keys: |
test-action_comment-line
test-action_to-rename
test-action_multiline
renaming-outputs: |
test-action_to-rename=test-action_renamed
test-action-output-comment-line:
name: GitHub Actions Test Output - Comment Line
Expand All @@ -45,12 +52,32 @@ jobs:
id: test-output-comment-line
run: |
test_name="Test Output Comment Line"
expected_result="./app ="
expected="./app ="
.github/scripts/test-action-output.sh \
"$test_name" \
"$expected_result" \
"$expected" \
"${{ needs.test-action.outputs.comment-line }}"
test-action-output-dont-read:
name: GitHub Actions Test Output - Don't Read
needs: test-action
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Test Output Don't Read
id: test-output-dont-read
run: |
test_name="Test Output Don't Read"
expected=''
.github/scripts/test-action-output.sh \
"$test_name" \
"$expected" \
"${{ needs.test-action.outputs.to-dont-read }}"
test-action-output-multiline:
name: GitHub Actions Test Output - Multiline
needs: test-action
Expand All @@ -65,9 +92,9 @@ jobs:
id: test-output-multiline
run: |
test_name="Test Output Multiline"
expected_result="### Heading\n\n* Bullet C:\\\\ E:\\\n* Driver D:\\\n* Points"
expected_result=$(printf '%s' "${expected_result}" | sed -e 's/\\n/\n/g')
expected="### Heading\n\n* Bullet C:\\\n* Driver D:\\\\\n* Points"
expected=$(printf '%s' "${expected_result}" | sed -e 's/\\n/\n/g')
.github/scripts/test-action-output.sh \
"$test_name" \
"$expected_result" \
"$expected" \
"${{ needs.test-action.outputs.multiline }}"
8 changes: 5 additions & 3 deletions yq-test-action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
test-action:
# comment
comment-line: ./app = #comment line
comment-line: ./app = #comment line
to-dont-read: this is not read
to-rename: this is will be renamed
multiline: |
### Heading
* Bullet C:\\ E:\
* Driver D:\
* Bullet C:\
* Driver D:\\
* Points

0 comments on commit 5f346d1

Please sign in to comment.