|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 2 | +# contributor license agreements. See the NOTICE file distributed with |
| 3 | +# this work for additional information regarding copyright ownership. |
| 4 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 5 | +# (the "License"); you may not use this file except in compliance with |
| 6 | +# the License. You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | +name: Playground Frontend Test |
| 17 | + |
| 18 | +on: |
| 19 | + push: |
| 20 | + paths: ['playground/frontend/**'] |
| 21 | + branches: ['**'] |
| 22 | + pull_request: |
| 23 | + paths: ['playground/frontend/**'] |
| 24 | + branches: ['**'] |
| 25 | + workflow_dispatch: |
| 26 | + |
| 27 | +# This allows a subsequently queued workflow run to interrupt previous runs |
| 28 | +concurrency: |
| 29 | + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' |
| 30 | + cancel-in-progress: true |
| 31 | + |
| 32 | +jobs: |
| 33 | + playground_frontend_test: |
| 34 | + name: Playground Frontend Test |
| 35 | + runs-on: ubuntu-latest |
| 36 | + |
| 37 | + env: |
| 38 | + FLUTTER_VERSION: '3.7.3' |
| 39 | + |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v3 |
| 42 | + |
| 43 | + - name: 'Cache Flutter Dependencies' |
| 44 | + uses: actions/cache@v3 |
| 45 | + with: |
| 46 | + path: /opt/hostedtoolcache/flutter |
| 47 | + key: ${{ runner.OS }}-flutter-install-cache-${{ env.FLUTTER_VERSION }} |
| 48 | + restore-keys: ${{ runner.OS }}-flutter-install-cache |
| 49 | + |
| 50 | + - uses: subosito/flutter-action@v2 |
| 51 | + with: |
| 52 | + flutter-version: ${{ env.FLUTTER_VERSION }} |
| 53 | + channel: 'stable' |
| 54 | + |
| 55 | + - name: 'Install Dependencies' |
| 56 | + working-directory: playground/frontend |
| 57 | + run: | |
| 58 | + cd playground_components && flutter pub get && cd .. |
| 59 | + cd playground_components_dev && flutter pub get && cd .. |
| 60 | + flutter pub get |
| 61 | +
|
| 62 | +# - name: 'Formatting' |
| 63 | +# run: dart format --output=none --set-exit-if-changed . |
| 64 | + |
| 65 | +# - name: 'Analyze playground_components' |
| 66 | +# working-directory: playground/frontend/playground_components |
| 67 | +# run: dart analyze --fatal-infos |
| 68 | + |
| 69 | +# - name: 'Analyze playground_components_dev' |
| 70 | +# working-directory: playground/frontend/playground_components_dev |
| 71 | +# run: dart analyze --fatal-infos |
| 72 | + |
| 73 | +# - name: 'Analyze playground' |
| 74 | +# working-directory: playground/frontend |
| 75 | +# run: dart analyze --fatal-infos lib test |
| 76 | + |
| 77 | + - name: 'Test playground_components' |
| 78 | + working-directory: playground/frontend/playground_components |
| 79 | + run: flutter test |
| 80 | + |
| 81 | + - name: 'Test playground' |
| 82 | + working-directory: playground/frontend |
| 83 | + run: flutter test |
| 84 | + |
| 85 | + - uses: nanasess/setup-chromedriver@v1 |
| 86 | + |
| 87 | + - name: 'Integration tests' |
| 88 | + run: | |
| 89 | + cp playground/frontend/lib/config.example.dart playground/frontend/lib/config.g.dart |
| 90 | + chromedriver --port=4444 & |
| 91 | + ./gradlew :playground:frontend:integrationTest -PdeviceId=web-server |
0 commit comments