Release/8.4.0 #184
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: Build Web on PRs | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
jobs: | |
build_web: | |
strategy: | |
matrix: | |
renderer: [html, canvaskit] | |
flutter_version: ['stable', 'beta'] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Flutter (${{ matrix.flutter_version }} channel) | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: ${{ matrix.flutter_version }} | |
cache: true | |
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache | |
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path | |
- name: Print flutter version | |
run: flutter --version | |
- name: Setup Melos | |
uses: bluefireteam/melos-action@v3 | |
- name: Pub get | |
run: flutter pub get | |
working-directory: flutter_theoplayer_sdk/flutter_theoplayer_sdk | |
- name: Run test | |
run: flutter test | |
working-directory: flutter_theoplayer_sdk/flutter_theoplayer_sdk | |
- name: Install Chrome Browser | |
uses: browser-actions/setup-chrome@v1 | |
with: | |
chrome-version: '121.0.6167.184' | |
id: setup-chrome | |
- name: Check Browser version | |
run: | | |
echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }} | |
${{ steps.setup-chrome.outputs.chrome-path }} --version | |
- name: Install Chromedriver | |
uses: nanasess/setup-chromedriver@v2 | |
with: | |
chromedriver-version: '121.0.6167.184' | |
- name: ⏳ Delay | |
run: | | |
echo "Waiting for Chromedriver to install..." | |
sleep 1 | |
- name: Check Chromedriver Version | |
run: chromedriver -v | |
# if we use '-d chrome' and '--no-headless' for 'flutter drive' later, we can enable this | |
# | |
- name: Configure non-headless display | |
run: | | |
export DISPLAY=:99.0 | |
echo "DISPLAY=:99.0" >> $GITHUB_ENV | |
Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & | |
sleep 3 | |
- name: Start Chromedriver | |
run: | | |
chromedriver --port=4444 --verbose --log-path=chromedriver.log & | |
- name: ⏳ Delay | |
run: | | |
echo "Waiting for Chromedriver to start..." | |
sleep 2 | |
- name: Check Chromedriver Port | |
run: | | |
lsof -i :4444 | |
- name: Run integration tests | |
run: | | |
flutter config --enable-web | |
flutter drive --driver=webdriver_integration_test/webdriver.dart --target=integration_test_single_entrypoint/entrypoint.dart -d web-server --web-renderer ${{ matrix.renderer }} --profile --driver-port=4444 -v --web-browser-flag="--disable-web-security --autoplay-policy=no-user-gesture-required" --chrome-binary ${{ steps.setup-chrome.outputs.chrome-path }} | |
working-directory: flutter_theoplayer_sdk/flutter_theoplayer_sdk/example | |
env: | |
TEST_LICENSE: ${{ secrets.TEST_LICENSE }} | |
- name: Print chromedriver logs | |
if: always() | |
run: | | |
cat chromedriver.log | |
- name: Build Web | |
run: flutter build web | |
working-directory: flutter_theoplayer_sdk/flutter_theoplayer_sdk/example | |
- name: Save WEB to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: web-${{ matrix.renderer }}-${{ matrix.flutter_version }} | |
path: flutter_theoplayer_sdk/flutter_theoplayer_sdk/example/build/web/ | |
retention-days: 5 |