File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Test
2+
3+ on :
4+ push :
5+ workflow_dispatch :
6+
7+ jobs :
8+ smoke-test :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v4
12+ # The datacontract container runs as a non-root user and writes the JUnit
13+ # report into the workspace, see README.
14+ - name : Make workspace writable for datacontract container
15+ run : chmod -R a+rwX "$GITHUB_WORKSPACE"
16+ - name : Run action against local test contract
17+ uses : ./
18+ with :
19+ location : tests/datacontract.yaml
20+ server : production
21+ junit-test-report : TEST-datacontract.xml
22+ - name : Assert JUnit report was written
23+ run : |
24+ test -s TEST-datacontract.xml
25+ grep -q 'failures="0"' TEST-datacontract.xml
26+ cat TEST-datacontract.xml
Original file line number Diff line number Diff line change @@ -20,13 +20,18 @@ inputs:
2020runs :
2121 using : ' docker'
2222 image : ' docker://datacontract/cli:latest'
23- entrypoint : /bin/sh
23+ # The image has no shell, so the CLI is invoked directly. The runner passes empty
24+ # args as literal "" (it does not drop them) and the CLI rejects an empty --publish
25+ # value, so the publish option is a single `--publish=<url>` arg that degrades to
26+ # `--no-logs` (the CLI's default behavior anyway) when the input is unset.
27+ entrypoint : datacontract
2428 args :
25- - -c
26- - >-
27- datacontract test
28- --server '${{ inputs.server }}'
29- --output-format junit
30- --output '${{ inputs.junit-test-report }}'
31- ${{ inputs.publish != '' && format('--publish ''{0}''', inputs.publish) || '' }}
32- '${{ inputs.location }}'
29+ - test
30+ - --server
31+ - ${{ inputs.server }}
32+ - --output-format
33+ - junit
34+ - --output
35+ - ${{ inputs.junit-test-report }}
36+ - ${{ inputs.publish != '' && format('--publish={0}', inputs.publish) || '--no-logs' }}
37+ - ${{ inputs.location }}
Original file line number Diff line number Diff line change 1+ order_id , amount
2+ 1 , 10.50
3+ 2 , 20.00
4+ 3 , 7.25
Original file line number Diff line number Diff line change 1+ dataContractSpecification : 1.1.0
2+ id : datacontract-action-smoke-test
3+ info :
4+ title : Smoke test contract for the GitHub Action
5+ version : 1.0.0
6+ servers :
7+ production :
8+ type : local
9+ path : tests/data/orders.csv
10+ format : csv
11+ models :
12+ orders :
13+ type : table
14+ fields :
15+ order_id :
16+ type : string
17+ required : true
18+ unique : true
19+ amount :
20+ type : decimal
You can’t perform that action at this time.
0 commit comments