| name: CI | |
| on: | |
| # Run on PRs and pushes to the default branch. | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| schedule: | |
| - cron: "0 0 * * 0" | |
| env: | |
| PUB_ENVIRONMENT: bot.github | |
| permissions: | |
| contents: read | |
| jobs: | |
| analyze: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| sdk: [dev] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| - uses: dart-lang/setup-dart@6afc89df92d6eb3834022f73cd65adc8cdfcb92d | |
| with: | |
| sdk: ${{ matrix.sdk }} | |
| - id: install | |
| name: Install dependencies | |
| run: dart pub get | |
| - name: Check formatting | |
| run: dart format --output=none --set-exit-if-changed . | |
| if: always() && steps.install.outcome == 'success' | |
| - name: Analyze code | |
| run: dart analyze --fatal-infos | |
| if: always() && steps.install.outcome == 'success' | |
| test_chrome: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| sdk: [3.4, stable, dev] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| - uses: dart-lang/setup-dart@6afc89df92d6eb3834022f73cd65adc8cdfcb92d | |
| with: | |
| sdk: ${{ matrix.sdk }} | |
| - uses: nanasess/setup-chromedriver@3e4b0086a2e0ed5f6d670fb0cfebc8c113977aa3 | |
| - id: install | |
| name: Install dependencies | |
| run: dart pub get | |
| - name: test | |
| run: | | |
| export DISPLAY=:99 | |
| chromedriver --port=4444 --url-base=/wd/hub & | |
| sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & | |
| dart test --exclude-tags ff | |
| if: always() && steps.install.outcome == 'success' | |
| env: | |
| CHROMEDRIVER_ARGS: '--no-sandbox --headless' | |
| test_firefox: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest ] | |
| sdk: [ 3.4, stable, dev ] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| - uses: dart-lang/setup-dart@6afc89df92d6eb3834022f73cd65adc8cdfcb92d | |
| with: | |
| sdk: ${{ matrix.sdk }} | |
| - uses: browser-actions/setup-firefox@0bc507ddf224827e3b1af68e014d5e42ab93e795 | |
| - uses: browser-actions/setup-geckodriver@eb8b0670366f719ca31703766a8cb7e3ea2c56ed | |
| - id: install | |
| name: Install dependencies | |
| run: dart pub get | |
| - name: test | |
| run: | | |
| export DISPLAY=:99 | |
| geckodriver --port=4445 & | |
| sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & | |
| dart test -j 1 --tags ff | |
| if: always() && steps.install.outcome == 'success' |