Skip to content

Commit

Permalink
Use stable oasdiff docker image tag instead of main (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahakL authored Sep 26, 2024
1 parent a2ff668 commit 1c611ff
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 29 deletions.
49 changes: 26 additions & 23 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ jobs:
oasdiff_breaking:
runs-on: ubuntu-latest
name: Test breaking changes
env:
OASDIFF_ACTION_TEST_EXPECTED_OUTPUT: "1 changes: 1 error, 0 warning, 0 info"
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -85,7 +87,6 @@ jobs:
with:
base: 'specs/base.yaml'
revision: 'specs/revision-breaking.yaml'
fail-on-diff: false
output-to-file: 'breaking.txt'
- name: Test breaking changes action output
run: |
Expand All @@ -94,8 +95,8 @@ jobs:
${{ steps.test_breaking_changes.outputs.breaking }}
$delimiter
)
if [ "$output" != "1 breaking changes: 1 error, 0 warning" ]; then
echo "Expected output '1 breaking changes: 1 error, 0 warning' but got '$output'" >&2
if [ "$output" != "$OASDIFF_ACTION_TEST_EXPECTED_OUTPUT" ]; then
echo "Expected output '$OASDIFF_ACTION_TEST_EXPECTED_OUTPUT' but got '$output'" >&2
exit 1
fi
- name: Test breaking changes action output to file
Expand All @@ -105,13 +106,15 @@ jobs:
exit 1
fi
output=$(cat breaking.txt | head -n 1)
if [[ "${output}" != "1 breaking changes: 1 error, 0 warning" ]]; then
echo "Expected output '1 breaking changes: 1 error, 0 warning' but got '${output}'" >&2
if [[ "${output}" != "$OASDIFF_ACTION_TEST_EXPECTED_OUTPUT" ]]; then
echo "Expected output '$OASDIFF_ACTION_TEST_EXPECTED_OUTPUT' but got '${output}'" >&2
exit 1
fi
oasdiff_breaking_fail_on:
runs-on: ubuntu-latest
name: Test fail on breaking changes
env:
OASDIFF_ACTION_TEST_EXPECTED_OUTPUT: "2 changes: 0 error, 2 warning, 0 info"
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -130,8 +133,8 @@ jobs:
${{ steps.test_breaking_changes.outputs.breaking }}
$delimiter
)
if [ "$output" != "2 breaking changes: 0 error, 2 warning" ]; then
echo "Expected output '2 breaking changes: 0 error, 2 warning' but got '$output'" >&2
if [ "$output" != "$OASDIFF_ACTION_TEST_EXPECTED_OUTPUT" ]; then
echo "Expected output '$OASDIFF_ACTION_TEST_EXPECTED_OUTPUT' but got '$output'" >&2
exit 1
fi
- name: Test breaking changes action output to file
Expand All @@ -141,13 +144,15 @@ jobs:
exit 1
fi
output=$(cat breaking.txt | head -n 1)
if [[ "${output}" != "2 breaking changes: 0 error, 2 warning" ]]; then
echo "Expected output '2 breaking changes: 0 error, 2 warning' but got '${output}'" >&2
if [[ "${output}" != "$OASDIFF_ACTION_TEST_EXPECTED_OUTPUT" ]]; then
echo "Expected output '$OASDIFF_ACTION_TEST_EXPECTED_OUTPUT' but got '${output}'" >&2
exit 1
fi
oasdiff_breaking_matching_delimiter_not_found:
runs-on: ubuntu-latest
name: Test breaking action with petsotre to validate no error of unable to process file command 'output' successfully and invalid value and matching delimiter not found
env:
OASDIFF_ACTION_TEST_EXPECTED_OUTPUT: "9 changes: 6 error, 3 warning, 0 info"
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -157,21 +162,22 @@ jobs:
with:
base: 'specs/petstore-base.yaml'
revision: 'specs/petstore-revision.yaml'
fail-on-diff: false
- name: Test breaking changes action output
run: |
delimiter=$(cat /proc/sys/kernel/random/uuid | tr -d '-')
output=$(cat <<-$delimiter
${{ steps.test_breaking_changes_matching_delimiter_not_found.outputs.breaking }}
$delimiter
)
if [ "$output" != "9 breaking changes: 6 error, 3 warning" ]; then
echo "Expected output '9 breaking changes: 6 error, 3 warning' but got '$output'" >&2
if [ "$output" != "$OASDIFF_ACTION_TEST_EXPECTED_OUTPUT" ]; then
echo "Expected output '$OASDIFF_ACTION_TEST_EXPECTED_OUTPUT' but got '$output'" >&2
exit 1
fi
oasdiff_breaking_composed:
runs-on: ubuntu-latest
name: Test breaking action with composed option
env:
OASDIFF_ACTION_TEST_EXPECTED_OUTPUT: "1 changes: 1 error, 0 warning, 0 info"
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -181,8 +187,6 @@ jobs:
with:
base: 'specs/glob/base/*.yaml'
revision: 'specs/glob/revision/*.yaml'
fail-on-diff: false
format: 'text'
composed: true
- name: Test breaking action output
run: |
Expand All @@ -191,8 +195,8 @@ jobs:
${{ steps.test_breaking_composed.outputs.breaking }}
$delimiter
)
if [[ ! "$output" =~ "1 breaking changes: 1 error, 0 warning" ]]; then
echo "Expected '1 breaking changes: 1 error, 0 warning', instead got '$output'" >&2
if [[ ! "$output" =~ "$OASDIFF_ACTION_TEST_EXPECTED_OUTPUT" ]]; then
echo "Expected '$OASDIFF_ACTION_TEST_EXPECTED_OUTPUT', instead got '$output'" >&2
exit 1
fi
oasdiff_breaking_deprecation:
Expand All @@ -213,12 +217,13 @@ jobs:
with:
base: specs/base.yaml
revision: specs/base-deprecation.yaml
fail-on-diff: true
deprecation-days-beta: 14
deprecation-days-stable: 21
oasdiff_changelog:
runs-on: ubuntu-latest
name: Test generation of changelog
env:
OASDIFF_ACTION_TEST_EXPECTED_OUTPUT: "21 changes: 2 error, 4 warning, 15 info"
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -231,10 +236,9 @@ jobs:
output-to-file: "changelog.txt"
- name: Test changelog action output
run: |
readonly expected_output="20 changes: 2 error, 4 warning, 14 info"
output=$(echo "${{steps.test_changelog.outputs.changelog}}" | head -n 1)
if [[ "${output}" != "${expected_output}" ]]; then
echo "Expected output '20 changes: 2 error, 4 warning, 14 info' but got '${output}'" >&2
if [[ "${output}" != "${OASDIFF_ACTION_TEST_EXPECTED_OUTPUT}" ]]; then
echo "Expected output '$OASDIFF_ACTION_TEST_EXPECTED_OUTPUT' but got '${output}'" >&2
exit 1
fi
- name: Test changelog action output to file
Expand All @@ -244,8 +248,8 @@ jobs:
exit 1
fi
output=$(cat changelog.txt | head -n 1)
if [[ "${output}" != "20 changes: 2 error, 4 warning, 14 info" ]]; then
echo "Expected output '20 changes: 2 error, 4 warning, 14 info' but got '${output}'" >&2
if [[ "${output}" != "${OASDIFF_ACTION_TEST_EXPECTED_OUTPUT}" ]]; then
echo "Expected output '$OASDIFF_ACTION_TEST_EXPECTED_OUTPUT' but got '${output}'" >&2
exit 1
fi
oasdiff_changelog_composed:
Expand All @@ -260,7 +264,6 @@ jobs:
with:
base: 'specs/glob/base/*.yaml'
revision: 'specs/glob/revision/*.yaml'
format: 'text'
composed: true
- name: Test changelog action output
run: |
Expand Down
4 changes: 2 additions & 2 deletions breaking/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM tufin/oasdiff:main
FROM tufin/oasdiff:stable
ENV PLATFORM github-action
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]
4 changes: 2 additions & 2 deletions changelog/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM tufin/oasdiff:main
FROM tufin/oasdiff:stable
ENV PLATFORM github-action
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]
4 changes: 2 additions & 2 deletions diff/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM tufin/oasdiff:main
FROM tufin/oasdiff:stable
ENV PLATFORM github-action
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]

0 comments on commit 1c611ff

Please sign in to comment.