|
| 1 | +# ===--- |
| 2 | +# Running on push & pull_request. |
| 3 | +# This workflow parses the destination branch |
| 4 | +# to choose correct dependencies revisions |
| 5 | +# ===--- |
| 6 | + |
| 7 | +name: On push & pull-request verification |
| 8 | +run-name: '${{ github.event_name }}: ${{ github.base_ref }} ${{ github.ref_name }}' # github.base_ref null for 'on: push' |
| 9 | + |
| 10 | +on: |
| 11 | + push: |
| 12 | + branches: |
| 13 | + - master |
| 14 | + - ocl-open-* |
| 15 | + pull_request: |
| 16 | + branches: |
| 17 | + - master |
| 18 | + - ocl-open-* |
| 19 | + types: |
| 20 | + - opened |
| 21 | + - reopened |
| 22 | + - synchronize # commit pushed to the PR |
| 23 | + - ready_for_review # moved from draft state |
| 24 | + |
| 25 | +jobs: |
| 26 | + |
| 27 | + verify_default_branch: |
| 28 | + name: Verify for `master` branch |
| 29 | + # ref_name for 'on: push' |
| 30 | + # base_ref for 'on: pull_request' |
| 31 | + if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || (github.event_name == 'pull_request' && github.base_ref == 'master') }} |
| 32 | + runs-on: ubuntu-22.04 |
| 33 | + steps: |
| 34 | + |
| 35 | + - name: Checkout opencl-clang sources for action files |
| 36 | + uses: actions/checkout@v3 |
| 37 | + |
| 38 | + - name: Run build-opencl-clang action |
| 39 | + uses: ./.github/actions/build-opencl-clang |
| 40 | + with: |
| 41 | + ref_llvm: main |
| 42 | + ref_translator: main |
| 43 | + ref_opencl-clang: ${{ github.ref }} |
| 44 | + |
| 45 | + verify_release_branch: |
| 46 | + name: Verify for `ocl-open-*` release branch |
| 47 | + # ref_name for 'on: push' |
| 48 | + # base_ref for 'on: pull_request' |
| 49 | + if: ${{ github.ref_name != 'master' && github.base_ref != 'master' }} |
| 50 | + runs-on: ubuntu-22.04 |
| 51 | + steps: |
| 52 | + |
| 53 | + - name: Checkout opencl-clang sources for action files |
| 54 | + uses: actions/checkout@v3 |
| 55 | + |
| 56 | + # This step will fail when the branch naming scheme 'ocl-open-XXX' changes! |
| 57 | + - name: Parse LLVM version from branch name |
| 58 | + id: check-llvm-version |
| 59 | + run: | |
| 60 | + BRANCH="${{ github.base_ref }}" # on: pull_request, otherwise null |
| 61 | + BRANCH=${BRANCH:-${{ github.ref_name }}} # on: push |
| 62 | + LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP '\d+') # Eg. 150 for LLVM 15 |
| 63 | + LLVM_VERSION_SHORT=${LLVM_VERSION_LONG::-1} # Eg. 15 for LLVM 15 |
| 64 | + echo "llvm_version=$LLVM_VERSION_SHORT" >> $GITHUB_OUTPUT |
| 65 | +
|
| 66 | + - name: Run build-opencl-clang action |
| 67 | + uses: ./.github/actions/build-opencl-clang |
| 68 | + with: |
| 69 | + ref_llvm: release/${{ steps.check-llvm-version.outputs.llvm_version }}.x |
| 70 | + ref_translator: llvm_release_${{ steps.check-llvm-version.outputs.llvm_version }}0 |
| 71 | + ref_opencl-clang: ${{ github.ref }} |
0 commit comments