|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | +# |
| 18 | +name: On Demand Tests |
| 19 | + |
| 20 | +on: |
| 21 | + workflow_dispatch: |
| 22 | + inputs: |
| 23 | + enable_ngrok_debug: |
| 24 | + description: "Enable Ngrok Debugging" |
| 25 | + required: true |
| 26 | + type: boolean |
| 27 | + default: false |
| 28 | + |
| 29 | +env: |
| 30 | + # (optional) you need to add as secrets an ngrok token and a password to debug a build on demand |
| 31 | + NGROK_DEBUG: ${{ inputs.enable_ngrok_debug }} |
| 32 | + NGROK_TOKEN: ${{ secrets.NGROK_TOKEN }} |
| 33 | + NGROK_PASSWORD: ${{ secrets.NGROK_PASSWORD }} |
| 34 | + |
| 35 | +permissions: read-all |
| 36 | + |
| 37 | +jobs: |
| 38 | + ci: |
| 39 | + runs-on: ubuntu-22.04 |
| 40 | + env: |
| 41 | + PUSH_NIGHTLY: ${{ (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/master' }} |
| 42 | + PUSH_RELEASE: ${{ github.event_name == 'push' && github.ref_type == 'tag' }} |
| 43 | + steps: |
| 44 | + # Checkout just this repo and run scanCode before we do anything else |
| 45 | + - name: Checkout runtime repo |
| 46 | + uses: actions/checkout@v3 |
| 47 | + with: |
| 48 | + path: runtime |
| 49 | + - name: Scan Code |
| 50 | + uses: apache/openwhisk-utilities/scancode@master |
| 51 | + |
| 52 | + # Install core OpenWhisk artifacts needed to build/test anything else |
| 53 | + - name: Checkout OpenWhisk core repo |
| 54 | + uses: actions/checkout@v4 |
| 55 | + with: |
| 56 | + repository: apache/openwhisk |
| 57 | + path: core |
| 58 | + - name: Setup Java |
| 59 | + uses: actions/setup-java@v3 |
| 60 | + with: |
| 61 | + distribution: 'temurin' |
| 62 | + java-version: '11' |
| 63 | + - name: Compile and Install Core OpenWhisk |
| 64 | + working-directory: core |
| 65 | + run: | |
| 66 | + ./gradlew :tests:compileTestScala |
| 67 | + ./gradlew install |
| 68 | +
|
| 69 | + # Build this repository |
| 70 | + - name: Build Runtime |
| 71 | + working-directory: runtime |
| 72 | + run: | |
| 73 | + ./gradlew distDocker |
| 74 | +
|
| 75 | + # Test this repository |
| 76 | + - name: Test Runtime |
| 77 | + id: tests |
| 78 | + working-directory: runtime |
| 79 | + run: | |
| 80 | + ./gradlew :tests:checkScalafmtAll |
| 81 | + ./gradlew :tests:test |
| 82 | + continue-on-error: true |
| 83 | + |
| 84 | + # (Optional) Enable debugging |
| 85 | + - name: Debug Action (if requested) |
| 86 | + working-directory: core |
| 87 | + run: ./tools/github/debugAction.sh |
| 88 | + - name: Wait for Debug (if requested) |
| 89 | + working-directory: core |
| 90 | + run: ./tools/github/waitIfDebug.sh |
| 91 | + - name: Results |
| 92 | + run: test "${{ steps.tests.outcome }}" == "success" |
0 commit comments