Skip to content

update LICENSE

update LICENSE #59

Workflow file for this run

name: Tests
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FLUTTER_PATH: "/tmp/flutter"
defaults:
run:
shell: bash
jobs:
tests:
name: Integration and Unit tests
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
pkg: [pubnub]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
- name: Checkout actions
uses: actions/checkout@v3
with:
repository: pubnub/client-engineering-deployment-tools
ref: v1
token: ${{ secrets.GH_TOKEN }}
path: .github/.release/actions
- name: Cache ${{ matrix.pkg }}
uses: actions/cache@v3
with:
path: ~/.pub-cache
key: ${{ runner.os }}-${{ matrix.pkg }}-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.pkg }}-
- name: Setup Dart stable
uses: dart-lang/[email protected]
- name: "Build and run tests for '${{ matrix.pkg }}'"
env:
PKG: ${{ matrix.pkg }}
FLUTTER: ${{ matrix.pkg == 'pubnub_flutter' && true || false }}
run: |
sudo -E apt-get -yq --no-install-suggests install lib32stdc++6
if [[ ${{ matrix.pkg }} == "pubnub_flutter" ]]; then
git clone https://github.com/flutter/flutter.git -b stable "$FLUTTER_PATH"
export PATH="$PATH:$FLUTTER_PATH/bin"
fi
dart pub global activate derry 1.5.0
cd "${{ github.workspace }}/${{ matrix.pkg }}"
[[ ${{ matrix.pkg }} == "pubnub_flutter" ]] && flutter pub get || dart pub get
derry validate analysis
derry validate formatting
derry test default
- name: Cancel workflow runs for commit on error
if: ${{ failure() }}
uses: ./.github/.release/actions/actions/utils/fast-jobs-failure
acceptance-tests:
name: Acceptance tests
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Checkout mock-server action
uses: actions/checkout@v3
with:
repository: pubnub/client-engineering-deployment-tools
ref: v1
token: ${{ secrets.GH_TOKEN }}
path: .github/.release/actions
- name: Run mock server action
uses: ./.github/.release/actions/actions/mock-server
with:
token: ${{ secrets.GH_TOKEN }}
- name: Setup Dart
uses: dart-lang/[email protected]
- name: Cache
uses: actions/cache@v3
with:
path: ~/.pub-cache
key: ${{ runner.os }}-${{ matrix.pkg }}-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.pkg }}-
- name: Run acceptance tests
run: |
cd acceptance_tests
dart pub get
export FEATURES_PATH=../sdk-specifications/features
dart pub run acceptance_tests
- name: Expose acceptance tests reports
uses: actions/upload-artifact@v3
with:
name: acceptance-test-reports
path: acceptance_tests/report.xml
- name: Cancel workflow runs for commit on error
if: ${{ failure() }}
uses: ./.github/.release/actions/actions/utils/fast-jobs-failure
all-tests:
name: Tests
runs-on: ubuntu-latest
needs: [tests, acceptance-tests]
steps:
- name: Tests summary
run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed"