Test/local httpbun #27
Workflow file for this run
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: Verify packages abilities | |
on: | |
push: | |
branches: | |
- main | |
- '6.0.0' | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
branches: | |
- main | |
- '6.0.0' | |
paths-ignore: | |
- "**.md" | |
# Ensure that new pushes/updates cancel running jobs | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash -leo pipefail {0} | |
jobs: | |
workflows: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
sdk: [ min, stable, beta ] | |
env: | |
TEST_PRESET: all | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
cache: true | |
flutter-version: ${{ matrix.sdk == 'min' && '2.8.0' || '' }} | |
channel: ${{ matrix.sdk == 'min' && '' || matrix.channel }} | |
- run: dart pub get | |
- uses: bluefireteam/melos-action@v3 | |
with: | |
run-bootstrap: false | |
- name: Check satisfied packages | |
run: | | |
dart ./scripts/melos_packages.dart | |
echo $(cat .melos_packages) >> $GITHUB_ENV | |
- name: Melos Bootstrap | |
run: melos bootstrap | |
- name: '[Verify step] Format' | |
if: ${{ matrix.sdk == 'stable' }} | |
run: melos run format | |
- name: '[Verify step] Analyze packages' | |
if: ${{ matrix.sdk == 'stable' }} | |
run: melos run analyze | |
- name: '[Verify step] Publish dry-run' | |
if: ${{ matrix.sdk == 'stable' }} | |
run: melos run publish-dry-run | |
# Tests | |
- run: | | |
chmod +x ./scripts/prepare_pinning_certs.sh | |
./scripts/prepare_pinning_certs.sh | |
- name: Install proxy for tests | |
run: sudo apt-get update && sudo apt-get install -y squid mkcert | |
- name: Start local httpbun | |
run: | | |
mkcert -install | |
mkcert -cert-file '/tmp/cert.pem' -key-file '/tmp/key.pem' httpbun.local | |
echo '127.0.0.1 httpbun.local' | sudo tee --append /etc/hosts | |
docker run \ | |
--name httpbun \ | |
--detach \ | |
--publish 443:443 \ | |
--volume /tmp:/tmp:ro \ | |
--env HTTPBUN_TLS_CERT=/tmp/cert.pem \ | |
--env HTTPBUN_TLS_KEY=/tmp/key.pem \ | |
--pull always \ | |
sharat87/httpbun | |
sleep 1 | |
curl --fail --silent --show-error https://httpbun.local/any | |
- name: Use local httpbun in tests | |
run: melos run httpbun:local | |
- name: '[Verify step] Test Dart packages [VM]' | |
run: melos run test:dart | |
- name: '[Verify step] Test Dart packages [Chrome]' | |
run: melos run test:web | |
env: | |
TEST_PLATFORM: chrome | |
- name: '[Verify step] Test Dart packages [Firefox]' | |
run: melos run test:web | |
env: | |
TEST_PLATFORM: firefox | |
- name: '[Verify step] Test Flutter packages' | |
run: melos run test:flutter | |
# Coverage | |
- name: '[Coverage] Format & print test coverage' | |
if: ${{ matrix.sdk == 'stable' }} | |
run: melos run coverage:show | |
- name: '[Coverage] Coverage Report' | |
uses: clearlyip/code-coverage-report-action@v4 | |
if: ${{ matrix.sdk == 'stable' && github.actor != 'dependabot[bot]'}} | |
with: | |
artifact_download_workflow_names: 'tests,coverage_base' | |
filename: 'coverage/cobertura.xml' |