(TESTING) ci testing #238
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- '*' | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
inputs: | |
SNAPSHOT: | |
type: boolean | |
description: Set SNAPSHOT true to publish | |
jobs: | |
lint_markdown_files: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '2.6' | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Install gem | |
run: | | |
gem install awesome_bot | |
- name: Run tests | |
run: find . -type f -name '*.md' -exec awesome_bot {} \; | |
integration_tests: | |
if: ${{ startsWith(github.ref, 'refs/tags/') != true && github.event.inputs.SNAPSHOT != 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
# You should create a personal access token and store it in your repository | |
token: ${{ secrets.CI_USER_TOKEN }} | |
repository: 'optimizely/travisci-tools' | |
path: 'home/runner/travisci-tools' | |
ref: 'master' | |
- name: set SDK Branch if PR | |
env: | |
HEAD_REF: ${{ github.head_ref }} | |
if: ${{ github.event_name == 'pull_request' }} | |
run: | | |
echo "SDK_BRANCH=${{ env.HEAD_REF }}" >> $GITHUB_ENV | |
echo "TRAVIS_BRANCH=${{ env.HEAD_REF }}" >> $GITHUB_ENV | |
- name: set SDK Branch if not pull request | |
if: ${{ github.event_name != 'pull_request' }} | |
run: | | |
echo "SDK_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV | |
echo "TRAVIS_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV | |
- name: Trigger build | |
env: | |
SDK: android | |
FULLSTACK_TEST_REPO: ${{ inputs.FULLSTACK_TEST_REPO }} | |
BUILD_NUMBER: ${{ github.run_id }} | |
TESTAPP_BRANCH: master | |
GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }} | |
EVENT_TYPE: ${{ github.event_name }} | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
#REPO_SLUG: ${{ github.repository }} | |
PULL_REQUEST_SLUG: ${{ github.repository }} | |
UPSTREAM_REPO: ${{ github.repository }} | |
PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} | |
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} | |
UPSTREAM_SHA: ${{ github.sha }} | |
TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} | |
EVENT_MESSAGE: ${{ github.event.message }} | |
HOME: 'home/runner' | |
run: | | |
echo "$GITHUB_CONTEXT" | |
home/runner/travisci-tools/trigger-script-with-status-update.sh | |
build: | |
uses: optimizely/android-sdk/.github/workflows/build.yml@master | |
with: | |
action: build | |
test: | |
if: ${{ startsWith(github.ref, 'refs/tags/') != true && github.event.inputs.SNAPSHOT != 'true' }} | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
api-level: [21, 25, 26, 29] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: set up JDK version | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 11 | |
- name: Set up Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: Install required SDK components | |
run: | | |
sdkmanager --install "platforms;android-${{ matrix.api-level }}" "build-tools;29.0.3" | |
sdkmanager --update | |
- name: Run Gradle task | |
run: ./gradlew testAllModules | |
publish: | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: optimizely/android-sdk/.github/workflows/build.yml@master | |
with: | |
action: ship | |
travis_tag: ${GITHUB_REF#refs/*/} | |
secrets: | |
MAVEN_SIGNING_KEY_BASE64: ${{ secrets.MAVEN_SIGNING_KEY_BASE64 }} | |
MAVEN_SIGNING_PASSPHRASE: ${{ secrets.MAVEN_SIGNING_PASSPHRASE }} | |
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
snapshot: | |
if: ${{ github.event.inputs.SNAPSHOT == 'true' && github.event_name == 'workflow_dispatch' }} | |
uses: optimizely/android-sdk/.github/workflows/build.yml@master | |
with: | |
action: ship | |
travis_tag: BB-SNAPSHOT | |
secrets: | |
MAVEN_SIGNING_KEY_BASE64: ${{ secrets.MAVEN_SIGNING_KEY_BASE64 }} | |
MAVEN_SIGNING_PASSPHRASE: ${{ secrets.MAVEN_SIGNING_PASSPHRASE }} | |
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} |