From eca02f9bde4f2395d8fe49b9911f7a3f93a02b07 Mon Sep 17 00:00:00 2001 From: tyranron Date: Wed, 12 May 2021 19:03:35 +0300 Subject: [PATCH] Improve CI jobs and their conditions --- .github/workflows/ci.yml | 88 ++++++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e916f1b7a..4605f2997 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,9 +45,9 @@ jobs: helm-lint: name: Lint Helm chart - if: ${{ !startsWith(github.ref, 'refs/tags/medea-') - && (github.ref == 'refs/heads/master' - || !contains(github.event.head_commit.message, '[skip ci]')) }} + if: ${{ github.ref == 'refs/heads/master' + || (!startsWith(github.ref, 'refs/tags/medea-') + && !contains(github.event.head_commit.message, '[skip ci]')) }} strategy: matrix: chart: @@ -60,8 +60,9 @@ jobs: dartfmt: if: ${{ github.ref == 'refs/heads/master' - || startsWith(github.ref, 'refs/tags/medea-') - || !contains(github.event.head_commit.message, '[skip ci]') }} + || startsWith(github.ref, 'refs/tags/medea-jason-') + || (!startsWith(github.ref, 'refs/tags/medea-') + && !contains(github.event.head_commit.message, '[skip ci]')) }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -72,8 +73,9 @@ jobs: dartanalyzer: if: ${{ github.ref == 'refs/heads/master' - || startsWith(github.ref, 'refs/tags/medea-') - || !contains(github.event.head_commit.message, '[skip ci]') }} + || startsWith(github.ref, 'refs/tags/medea-jason-') + || (!startsWith(github.ref, 'refs/tags/medea-') + && !contains(github.event.head_commit.message, '[skip ci]')) }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -244,10 +246,11 @@ jobs: - run: make test.integration up=yes dockerized=no test-flutter: - name: Flutter Android tests + name: Flutter tests if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/medea-jason-') - || !contains(github.event.head_commit.message, '[skip ci]') }} + || (!startsWith(github.ref, 'refs/tags/medea-') + && !contains(github.event.head_commit.message, '[skip ci]')) }} runs-on: macos-latest steps: - uses: actions/checkout@v2 @@ -277,13 +280,15 @@ jobs: run: make cargo.build crate=medea-jason platform=android targets=x86 args="--features mockable" - - uses: reactivecircus/android-emulator-runner@v2 + - name: Test on min Android NDK version + uses: reactivecircus/android-emulator-runner@v2 with: api-level: ${{ steps.ndk-version.outputs.min }} target: google_apis profile: Nexus 6 script: make test.flutter - - uses: reactivecircus/android-emulator-runner@v2 + - name: Test on target Android NDK version + uses: reactivecircus/android-emulator-runner@v2 with: api-level: ${{ steps.ndk-version.outputs.target }} target: google_apis @@ -297,11 +302,17 @@ jobs: # Building # ############ - crate-jason-web: - name: Build medea-jason for web platform - if: ${{ !startsWith(github.ref, 'refs/tags/medea-') - && (github.ref == 'refs/heads/master' - || !contains(github.event.head_commit.message, '[skip ci]')) }} + crate-jason: + name: Build medea-jason + if: ${{ github.ref == 'refs/heads/master' + || startsWith(github.ref, 'refs/tags/medea-jason-') + || (!startsWith(github.ref, 'refs/tags/medea-') + && !contains(github.event.head_commit.message, '[skip ci]')) }} + strategy: + matrix: + platform: + - web + - android runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -309,39 +320,46 @@ jobs: with: profile: minimal toolchain: stable - target: wasm32-unknown-unknown - - uses: Swatinem/rust-cache@v1 - if: ${{ !contains(github.event.head_commit.message, '[fresh ci]') }} - - uses: jetli/wasm-pack-action@v0.3.0 - - run: make cargo.build crate=medea-jason dockerized=no debug=yes - - crate-jason-android: - name: Build medea-jason shared object for Android platform - if: ${{ !startsWith(github.ref, 'refs/tags/medea-') - && (github.ref == 'refs/heads/master' - || !contains(github.event.head_commit.message, '[skip ci]')) }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 + if: ${{ matrix.platform != 'web' }} - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable + target: wasm32-unknown-unknown + if: ${{ matrix.platform == 'web' }} - uses: Swatinem/rust-cache@v1 if: ${{ !contains(github.event.head_commit.message, '[fresh ci]') }} + + - uses: jetli/wasm-pack-action@v0.3.0 + if: ${{ matrix.platform == 'web' }} + - uses: actions-rs/install@v0.1 with: crate: cargo-ndk use-tool-cache: true + if: ${{ matrix.platform == 'android' }} - run: make rustup.android - - run: make cargo.build crate=medea-jason platform=android + if: ${{ matrix.platform == 'android' }} + + - run: make cargo.build crate=medea-jason platform=${{ matrix.platform }} dockerized=no debug=yes crate-medea: name: Build medea - if: ${{ !startsWith(github.ref, 'refs/tags/medea-') - && (github.ref == 'refs/heads/master' - || !contains(github.event.head_commit.message, '[skip ci]')) }} + if: ${{ github.ref == 'refs/heads/master' + || startsWith(github.ref, 'refs/tags/medea-0') + || startsWith(github.ref, 'refs/tags/medea-1') + || startsWith(github.ref, 'refs/tags/medea-2') + || startsWith(github.ref, 'refs/tags/medea-3') + || startsWith(github.ref, 'refs/tags/medea-4') + || startsWith(github.ref, 'refs/tags/medea-5') + || startsWith(github.ref, 'refs/tags/medea-6') + || startsWith(github.ref, 'refs/tags/medea-7') + || startsWith(github.ref, 'refs/tags/medea-8') + || startsWith(github.ref, 'refs/tags/medea-9') + || (!startsWith(github.ref, 'refs/tags/medea-') + && !contains(github.event.head_commit.message, '[skip ci]')) }} + # nope, that's OK... runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -404,7 +422,7 @@ jobs: || startsWith(github.ref, 'refs/tags/medea-7') || startsWith(github.ref, 'refs/tags/medea-8') || startsWith(github.ref, 'refs/tags/medea-9') }} - # nope, that's OK... + # still, that's OK... docker: name: Docker image