Fix mechanism for getting package version, when git is not present #169
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ion-test-driver | |
on: [pull_request] | |
jobs: | |
ion-test-driver: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ion-c | |
uses: actions/checkout@master | |
with: | |
repository: amazon-ion/ion-c | |
ref: master | |
path: ion-c | |
- name: Checkout ion-test-driver | |
uses: actions/checkout@master | |
with: | |
repository: amazon-ion/ion-test-driver | |
ref: master | |
path: ion-test-driver | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- 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-c && 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-c && 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-c,${{ github.event.pull_request.head.repo.html_url }},${{ github.event.pull_request.head.sha }} | |
--replace ion-c,https://github.com/amazon-ion/ion-c.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-c,$main ion-c,$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 |