Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
Improve CI jobs and their conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed May 12, 2021
1 parent 8bbacc4 commit eca02f9
Showing 1 changed file with 53 additions and 35 deletions.
88 changes: 53 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -297,51 +302,64 @@ 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
- uses: actions-rs/toolchain@v1
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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eca02f9

Please sign in to comment.