131 lines
4.5 KiB
YAML
131 lines
4.5 KiB
YAML
name: "All the sdk specific jobs"
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
e2ee_test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
homeserver: [synapse, dendrite, conduit]
|
|
# since the dendrite job is optional, actually run all tests to the end instead of failing on first error.
|
|
fail-fast: false
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
|
- name: Run tests
|
|
run: |
|
|
export NETWORK='--network mynet'
|
|
docker network create mynet
|
|
# deploy homeserver instance
|
|
scripts/integration-server-${{matrix.homeserver}}.sh
|
|
docker run $NETWORK --env GITHUB_ACTIONS="${GITHUB_ACTIONS}" --env HOMESERVER_IMPLEMENTATION="${{matrix.homeserver}}" --env HOMESERVER="${{startsWith('dendrite', matrix.homeserver) && format('{0}:8008', matrix.homeserver) || matrix.homeserver }}" --volume="$(pwd):/workdir" --workdir /workdir ghcr.io/famedly/container-image-flutter/flutter:${{env.flutter_version}} /bin/bash -c "set -e
|
|
scripts/integration-prepare-alpine.sh
|
|
# create test user environment variables
|
|
source scripts/integration-create-environment-variables.sh
|
|
# properly set the homeserver IP and create test users
|
|
scripts/integration-prepare-homeserver.sh
|
|
# setup OLM
|
|
scripts/prepare.sh
|
|
scripts/test_driver.sh"
|
|
|
|
coverage_without_olm:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
NO_OLM: 1
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
|
- uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46
|
|
with:
|
|
sdk: ${{ env.dart_version }}
|
|
- name: Run tests
|
|
run: |
|
|
sudo apt-get update && sudo apt-get install --no-install-recommends --no-install-suggests -y curl lcov python3 python3-distutils libsqlite3-0 libsqlite3-dev
|
|
./scripts/test.sh
|
|
- uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: coverage_without_olm
|
|
path: coverage_dir/
|
|
retention-days: 1
|
|
|
|
|
|
coverage:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
|
- uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46
|
|
with:
|
|
sdk: ${{ env.dart_version }}
|
|
- name: Run tests
|
|
run: |
|
|
sudo apt-get update && sudo apt-get install --no-install-recommends --no-install-suggests -y curl lcov python3 python3-distutils libsqlite3-0 libsqlite3-dev libolm3 libssl3
|
|
./scripts/test.sh
|
|
- uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: coverage
|
|
path: coverage_dir/
|
|
retention-days: 1
|
|
|
|
|
|
merge_converage:
|
|
if: always()
|
|
runs-on: ubuntu-latest
|
|
needs: [coverage, coverage_without_olm]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/download-artifact@v4
|
|
- name: Merge lcov files
|
|
run: |
|
|
sudo apt-get -y install lcov
|
|
lcov -a coverage/lcov.info -a coverage_without_olm/lcov.info -o merged.info
|
|
genhtml merged.info -o merged
|
|
echo $(lcov --summary merged.info | grep 'lines......:') >> $GITHUB_STEP_SUMMARY
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: merged
|
|
path: merged/
|
|
retention-days: 1
|
|
|
|
review_app_coverage:
|
|
if: github.event_name == 'pull_request'
|
|
needs: [merge_converage]
|
|
secrets: inherit
|
|
uses: famedly/frontend-ci-templates/.github/workflows/review-app.yml@main
|
|
with:
|
|
projectname: "matrix-dart-sdk-coverage"
|
|
pr: ${{ github.event.pull_request.number }}
|
|
environment: "review"
|
|
artifact-name: "merged"
|
|
|
|
dart_web_compatible:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
|
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
|
|
with:
|
|
flutter-version: ${{ env.flutter_version }}
|
|
- name: Ensure SDK compiles on web
|
|
run: |
|
|
pushd web_test
|
|
dart pub get
|
|
dart run webdev build
|
|
|
|
pub-dev-dry-run:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
|
- uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46
|
|
with:
|
|
sdk: ${{ env.dart_version }}
|
|
- name: pub.dev publish dry run
|
|
run: |
|
|
dart pub get
|
|
dart pub publish --dry-run
|