Skip to content

wsl-workflow

wsl-workflow #1

Workflow file for this run

name: wsl-workflow
on:
workflow_dispatch:
jobs:
check_approve_count:
permissions:
pull-requests: read
runs-on: ubuntu-latest
outputs:
approve_count: ${{ steps.reviews.outputs.approved }}
steps:
- name: Check pull request is approved
id: 'reviews'
uses: jrylan/github-action-reviews-counter@main
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
- name: Print current approve count
run: echo "Current Approve count ${{ steps.reviews.outputs.approved }}"
integration-tests-wsl:
needs: [check_approve_count]
permissions:
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
contents: read # for actions/checkout to fetch code
if: 'needs.check_approve_count.outputs.approve_count >= 2'
runs-on: windows-2019
defaults:
run:
shell: wsl-bash {0}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: Vampire/setup-wsl@v2
with:
distribution: Ubuntu-20.04
additional-packages:
dos2unix
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-2-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-2-gradle-
- name: Set GCLOUD_KEY for WSL
shell: cmd
run: |
echo ${{ secrets.GCLOUD_KEY }} > gcloud_key.txt
- name: Configure WSL for flank
run: |
find . -type f -print0 | xargs -0 -n 1 -P 4 dos2unix
chmod +x gradlew
sudo apt-get -y install openjdk-8-jdk
- name: Gradle clean build
run: |
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
export HEAD_REF=${{ github.ref }}
./gradlew clean build
- name: Prepare Google Service Account
run: |
GCLOUD_KEY=$(cat gcloud_key.txt)
GCLOUD_DIR="$HOME/.config/gcloud/"
mkdir -p "$GCLOUD_DIR"
echo "$GCLOUD_KEY" | base64 --ignore-garbage --decode > "$GCLOUD_DIR/application_default_credentials.json"
- name: Gradle Integration Tests Android
uses: gradle/[email protected]
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
with:
arguments: "--info :integration_tests:test --tests IntegrationTests.shouldMatchAndroidSuccessExitCodeAndPattern -Dflank-path=../test_runner/build/libs/flank.jar -Dyml-path=./src/test/resources/flank_android.yml"
- name: Gradle Integration Tests iOS
uses: gradle/[email protected]
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
with:
arguments: "--info :integration_tests:test --tests IntegrationTests.shouldMatchIosSuccessExitCodeAndPattern -Dflank-path=../test_runner/build/libs/flank.jar -Dyml-path=./src/test/resources/flank_ios.yml"