Validate the TSL Generator #70
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: Generating with py3.8-3.12 | |
run-name: Validate the TSL Generator | |
on: | |
pull_request: | |
branches: | |
- main | |
types: [opened, synchronize, reopened, edited] | |
jobs: | |
setup: | |
uses: ./.github/workflows/setup-environment.yml | |
with: | |
requirement-file: "requirements.txt" | |
docker-tag: "${{ vars.VALIDATION_TAG}}" | |
context: ".github/actions/tsl-validate" | |
secrets: | |
DOCKERHUB_USER: ${{ secrets.DOCKER_HUB_USER }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
validate: | |
runs-on: ubuntu-latest | |
needs: setup | |
name: Job to validate the TSL Generator | |
strategy: | |
matrix: | |
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Checkout PR and merge | |
uses: check-spelling/[email protected] | |
- name: Cancel on Merge fail | |
if: env.MERGE_FAILED == '1' | |
run: | |
echo "Merge failed, cancelling the job" | |
exit 1 | |
- name: TSL Validate | |
id: validate | |
uses: ./.github/actions/tsl-validate | |
with: | |
python-version: ${{ matrix.python_version }} | |
image: ${{ vars.VALIDATION_TAG }} | |
- name: Upload Logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: validate_${{ steps.validate.outputs.name }} | |
path: ${{ github.workspace }}/${{ steps.validate.outputs.out }} | |
overwrite: true | |
retention-days: 1 | |
- name: Output on Error | |
if: ${{ steps.validate.outputs.success == 'false' }} | |
run: | | |
echo "Generation (with ${{ matrix.python_version }} failed" | |
echo "${{ steps.validate.outputs.msg }}" | |
cat ${{ github.workspace }}/${{ steps.validate.outputs.out }}/${{ steps.validate.outputs.failout}} | |
touch ${{ github.workspace }}/python_generation_failed | |
- name: Upload on Error | |
if: ${{ steps.validate.outputs.success == 'false' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python_generation_failed | |
path: ${{ github.workspace }} | |
retention-days: 1 | |
- name: Fail on Error | |
if: ${{ steps.validate.outputs.success == 'false' }} | |
run: exit 1 |