Skip to content

Commit

Permalink
[wip]
Browse files Browse the repository at this point in the history
  • Loading branch information
anniel-stripe committed Dec 19, 2022
1 parent fd15754 commit 52c5167
Showing 1 changed file with 64 additions and 63 deletions.
127 changes: 64 additions & 63 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,73 +43,74 @@ jobs:
- name: Build artifacts
run: ./gradlew assemble javadoc

test:
name: Test

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
java-version:
- "1.8"
- "9"
- "10"
- "11"
- "12"
- "13"
- "14"
- "15"
- "16"
- "17"
- "18"

steps:
- uses: actions/checkout@master

- name: Setup Test Java Runtime
id: setup-test-jre
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
architecture: x64

- name: Set Test Java Runtime Environment variable
run: echo "JAVA_TEST_HOME=${{ steps.setup-test-jre.outputs.path }}" >> $GITHUB_ENV

- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: "17" # always use 17 LTS for building
architecture: x64

- name: Tweak gradle.properties for Java 1.8
if: ${{ matrix.java-version == '1.8' }}
run: sed -e '/--add-exports/ s/^#*/#/' -i gradle.properties

- name: Display version
run: |
./gradlew --version
echo "JAVA_TEST_HOME=$JAVA_TEST_HOME"
- name: Start stripe-mock
run: docker run -d -p 12111-12112:12111-12112 stripe/stripe-mock && sleep 5

- name: Run test suite
run: ./gradlew test

- name: Send code coverage report to coveralls.io
run: ./gradlew jacocoTestReport coveralls
if: env.COVERALLS_REPO_TOKEN && matrix.java-version == '17'
env:
CI_NAME: github-actions
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
# test:
# name: Test

# runs-on: ubuntu-latest

# strategy:
# fail-fast: false
# matrix:
# java-version:
# - "1.8"
# - "9"
# - "10"
# - "11"
# - "12"
# - "13"
# - "14"
# - "15"
# - "16"
# - "17"
# - "18"

# steps:
# - uses: actions/checkout@master

# - name: Setup Test Java Runtime
# id: setup-test-jre
# uses: actions/setup-java@v1
# with:
# java-version: ${{ matrix.java-version }}
# architecture: x64

# - name: Set Test Java Runtime Environment variable
# run: echo "JAVA_TEST_HOME=${{ steps.setup-test-jre.outputs.path }}" >> $GITHUB_ENV

# - name: Setup Java
# uses: actions/setup-java@v1
# with:
# java-version: "17" # always use 17 LTS for building
# architecture: x64

# - name: Tweak gradle.properties for Java 1.8
# if: ${{ matrix.java-version == '1.8' }}
# run: sed -e '/--add-exports/ s/^#*/#/' -i gradle.properties

# - name: Display version
# run: |
# ./gradlew --version
# echo "JAVA_TEST_HOME=$JAVA_TEST_HOME"

# - name: Start stripe-mock
# run: docker run -d -p 12111-12112:12111-12112 stripe/stripe-mock && sleep 5

# - name: Run test suite
# run: ./gradlew test

# - name: Send code coverage report to coveralls.io
# run: ./gradlew jacocoTestReport coveralls
# if: env.COVERALLS_REPO_TOKEN && matrix.java-version == '17'
# env:
# CI_NAME: github-actions
# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

publish:
if: >-
((github.event_name == 'workflow_dispatch') || (github.event_name == 'pull_request')) &&
endsWith(github.actor, '-stripe')
needs: [build, test]
# needs: [build, test]
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand All @@ -132,7 +133,7 @@ jobs:

- name: Publish package
run: |
./gradlew publishToSonatype closeSonatypeStagingRepository -Dorg.gradle.project.NEXUS_USERNAME=$NEXUS_USERNAME -Dorg.gradle.project.NEXUS_PASSWORD=$NEXUS_PASSWORD -Dorg.gradle.project.signing.gnupg.keyName=$GPG_SIGNING_KEYID -Dorg.gradle.project.signing.gnupg.passphrase=$GPG_SIGNING_PASSPHRASE
./gradlew publish closeSonatypeStagingRepository -Dorg.gradle.project.NEXUS_USERNAME=$NEXUS_USERNAME -Dorg.gradle.project.NEXUS_PASSWORD=$NEXUS_PASSWORD -Dorg.gradle.project.signing.gnupg.keyName=$GPG_SIGNING_KEYID -Dorg.gradle.project.signing.gnupg.passphrase=$GPG_SIGNING_PASSPHRASE
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
Expand Down

0 comments on commit 52c5167

Please sign in to comment.