Skip to content

馃摑 Add test-certificate-and-key convention to AGENTS.md (#2585) #257

馃摑 Add test-certificate-and-key convention to AGENTS.md (#2585)

馃摑 Add test-certificate-and-key convention to AGENTS.md (#2585) #257

Workflow file for this run

name: 'coverage_baseline'
# The code-coverage-report-action uses workflow artifacts to store the coverage report.
# The action will upload the coverage report as an artifact,
# and the action will also download the coverage report from the artifact in PRs.
# The action will then compare the coverage report from the PR with the coverage report from the base branch.
# For this to work, the action needs to be run on the base branch after each pushed commit
# or at least once before the artifact retention period ends.
on:
# Allow for manual runs
workflow_dispatch:
# Runs at 00:00, on day 1 of the month (every ~30 days)
schedule:
- cron: '0 0 1 * *'
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref_name }}
cancel-in-progress: true
# Disable permissions for all of the available permissions
permissions: {}
jobs:
generate:
runs-on: ubuntu-latest
env:
TEST_PRESET: all
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
with:
persist-credentials: false
- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 #v2.23.0
with:
cache: true
- name: Install proxy for tests
run: sudo apt-get update && sudo apt-get install -y squid
- run: dart pub get
- uses: bluefireteam/melos-action@2982f8e4fc92440a219490009d6d05195cb1a6a5 #v3.8.0
with:
run-bootstrap: false
melos-version: '^6.0.0'
- name: Check satisfied packages
run: |
dart ./scripts/melos_packages.dart
echo $(cat .melos_packages) >> $GITHUB_ENV
- name: Melos Bootstrap
run: melos bootstrap
# Tests
- 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
docker run \
--name httpbun-http \
--detach \
--publish 80:80 \
--pull always \
sharat87/httpbun
sleep 1
curl --fail --silent --show-error https://httpbun.local/any
curl --fail --silent --show-error http://httpbun.local/any
- name: Prepare pinning certificates
run: HTTPBUN_HOST=httpbun.local ./scripts/prepare_pinning_certs.sh
- name: Use httpbun.local for tests
run: melos run httpbun:local
- name: '[Verify step] Test Dart packages [VM]'
run: melos run test:vm
- name: Use local HTTP for Web/Flutter tests
run: melos run httpbun:local:http
- name: '[Verify step] Test Dart packages [Chrome]'
run: melos run test:web:chrome
- name: '[Verify step] Test Dart packages [Firefox]'
run: melos run test:web:firefox
- name: '[Verify step] Test Flutter packages'
run: melos run test:flutter
- name: '[Coverage] Generate report'
run: melos run coverage:combine
- uses: clearlyip/code-coverage-report-action@110af9d4ec87b6706f182fd90e3102af9e5203bf #v7.0.0
with:
filename: 'coverage/cobertura.xml'