Skip to content

Commit 2dee241

Browse files
committed
Use stdin and stdout for CI tests to avoid issues
1 parent 564c5a8 commit 2dee241

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,4 @@ jobs:
3737
run: npm install
3838

3939
- name: Run CI tests inside container
40-
working-directory: ${{ github.workspace }}
4140
run: ./convert-and-validate-specs.sh

convert-and-validate-specs.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ if ! [ -d output ]; then
66
mkdir output
77
fi
88

9-
# Read in stdin and output to stdout
109
echo 'Converting 3.1 spec to 3.0'
1110
docker run --rm -i openapi-spec-converter:latest -t 3.0 -f yaml \
1211
< specs/31-spec-with-differences-from-30.yaml \
@@ -20,23 +19,20 @@ if ! node_modules/.bin/swagger-cli validate output/31-spec-with-differences-from
2019
fi
2120

2221
echo 'Converting 3.1 spec to Swagger'
23-
# Read in from a filename and output to a filename
24-
docker run --volume ./specs:/specs:ro --volume ./output:/output --rm \
25-
-i openapi-spec-converter:latest -t swagger -f yaml \
26-
-o /output/31-spec-with-differences-from-30.converted-swagger.yaml \
27-
/specs/31-spec-with-differences-from-30.yaml
22+
docker run --rm -i openapi-spec-converter:latest -t swagger -f yaml \
23+
< specs/31-spec-with-differences-from-30.yaml \
24+
> output/31-spec-with-differences-from-30.converted-swagger.yaml
2825

2926
echo 'Validating 3.1 spec converted to Swagger'
3027
if ! node_modules/.bin/swagger-cli validate output/31-spec-with-differences-from-30.converted-swagger.yaml; then
3128
exit_code=1
3229
fi
3330

34-
echo 'Converting 3.1 to Swagger spec back to 3.1 again'
3531
# Up convert Swagger file back to OpenAPI 3.1 again, and output as JSON
36-
docker run --volume ./output:/output \
37-
--rm -i openapi-spec-converter:latest -t 3.1 -f json \
38-
-o /output/31-spec-with-differences-from-30.back-to-31.yaml \
39-
/output/31-spec-with-differences-from-30.converted-swagger.yaml
32+
echo 'Converting 3.1 to Swagger spec back to 3.1 again'
33+
docker run --rm -i openapi-spec-converter:latest -t 3.1 -f json \
34+
< output/31-spec-with-differences-from-30.back-to-31.yaml \
35+
> output/31-spec-with-differences-from-30.converted-swagger.yaml
4036

4137
echo 'Validating 3.1 spec converted back from Swagger'
4238
if ! node_modules/.bin/redocly lint output/31-spec-with-differences-from-30.converted-swagger.yaml 2>&1; then

0 commit comments

Comments
 (0)