-
Notifications
You must be signed in to change notification settings - Fork 8
67 lines (65 loc) · 2.21 KB
/
validate-tsl.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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