Skip to content

Commit

Permalink
Consolidate workflows
Browse files Browse the repository at this point in the history
Signed-off-by: matt-ramotar <matt.ramotar@uber.com>
  • Loading branch information
matt-ramotar committed Nov 24, 2024
1 parent 30bbb47 commit 5f71f5a
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 67 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/check.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,63 +1,83 @@
# This workflow will build the project with Gradle, run integration tests, and release.
# Because secrets are not available on external forks, this job is expected to fail
# on external pull requests.

name: Build project & run tests
name: CI

on:
push:
branches: [ main ]
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
api-level:
- 29
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Grant execute permission for Gradlew
run: chmod +x gradlew

- name: Build and Test with Coverage
run: ./gradlew clean build koverXmlReport --stacktrace

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/reports/kover/coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
verbose: true

publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'MobileNativeFoundation/Store'
runs-on: macos-latest
if: github.repository == 'MobileNativeFoundation/Store' && github.ref == 'refs/heads/main'

needs: build-and-test
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up our JDK environment

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 11
distribution: 'zulu'
java-version: '11'

- name: Upload Artifacts
- name: Grant execute permission for Gradlew
run: chmod +x gradlew

- name: Upload Artifacts to Maven Central
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

- name: Retrieve version
- name: Retrieve Version
run: |
echo "VERSION_NAME=$(cat gradle.properties | grep -w "VERSION_NAME" | cut -d'=' -f2)" >> $GITHUB_ENV
- name: Publish release
- name: Publish Release
run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel
if: "!endsWith(env.VERSION_NAME, '-SNAPSHOT')"
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
test:
runs-on: ubuntu-latest
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
api-level:
- 29

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up our JDK environment
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 11
- name: Run tests
run: ./gradlew check --rerun-tasks --stacktrace
- name: Upload code coverage
run: bash <(curl -s https://codecov.io/bash)
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
13 changes: 0 additions & 13 deletions .github/workflows/codecov.yml

This file was deleted.

0 comments on commit 5f71f5a

Please sign in to comment.