Skip to content

Change source code to test workflow #187

Change source code to test workflow

Change source code to test workflow #187

name: ion-test-driver
on: [pull_request]
jobs:
PR-Content-Check:
uses: amazon-ion/ion-java/.github/workflows/PR-content-check.yml@master

Check failure on line 7 in .github/workflows/ion-test-driver.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ion-test-driver.yml

Invalid workflow file

error parsing called workflow ".github/workflows/ion-test-driver.yml" -> "amazon-ion/ion-java/.github/workflows/PR-content-check.yml@master" : failed to fetch workflow: workflow was not found.
ion-test-driver:
runs-on: ubuntu-latest
needs: PR-Content-Check
if: ${{ needs.PR-Content-Check.outputs.result == 'pass' }}
steps:
- name: Checkout ion-java
uses: actions/checkout@master
with:
repository: amazon-ion/ion-java
ref: master
path: ion-java
- name: Checkout ion-test-driver
uses: actions/checkout@master
with:
repository: amazon-ion/ion-test-driver
ref: master
path: ion-test-driver
- name: Set up python3 env
run: python3 -m venv ion-test-driver/venv && . ion-test-driver/venv/bin/activate
- name: Pip install
run: pip3 install -r ion-test-driver/requirements.txt && pip3 install -e ion-test-driver
- name: Get main branch HEAD sha
run: cd ion-java && echo `git rev-parse --short=7 HEAD` && echo "main=`git rev-parse --short=7 HEAD`" >> $GITHUB_ENV
- name: Get current commit sha
run: cd ion-java && echo `git rev-parse --short=7 ${{ github.event.pull_request.head.sha }}`
&& echo "cur=`git rev-parse --short=7 ${{ github.event.pull_request.head.sha }}`" >> $GITHUB_ENV
- name: Run ion-test-driver
run: python3 ion-test-driver/amazon/iontest/ion_test_driver.py -o output
-i ion-java,${{ github.event.pull_request.head.repo.html_url }},${{ github.event.pull_request.head.sha }}
--replace ion-java,https://github.com/amazon-ion/ion-java.git,$main
- name: Upload result
uses: actions/upload-artifact@v2
with:
name: ion-test-driver-result.ion
path: output/results/ion-test-driver-results.ion
- name: showing result
run: cat output/results/ion-test-driver-results.ion
- name: Analyze two implementations
continue-on-error: true
id: result-diff
run: python3 ion-test-driver/amazon/iontest/ion_test_driver.py -R
ion-java,$main ion-java,$cur output/results/ion-test-driver-results.ion
- name: Upload analysis report
uses: actions/upload-artifact@v2
with:
name: analysis-report.ion
path: result.ion
- name: showing report
run: cat result.ion
- name: Check if ion-test-driver fails
if: ${{ steps.result-diff.outcome == 'failure' }}
run: echo 'Implementation behavior changed, Refer to the analysis report in the previous step for the reason.' && exit 1
open-issue:
runs-on: ubuntu-latest
needs: ion-test-driver
if: ${{ failure() }}
steps:
- uses: actions/checkout@master
- name: Open an issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_WORKFLOW_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha }}
with:
assignees: ${{ github.event.sender.login }}
filename: .github/ion-test-driver-issue.md