-
Notifications
You must be signed in to change notification settings - Fork 32
chore: removed travis yml and added git action support #469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 12 commits
a29f4b0
a27d10c
1e06bc9
83556cb
72c9abf
1316737
2504e08
84ed08f
4c89536
4b55c39
1e41105
c01025a
dc7f868
aad83ff
5b8b518
4d56a25
a55e43b
864d388
f05dbdc
673d5df
7345965
2c9f290
8889af9
d63a1de
087572f
9e54d58
f8863ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: Reusable action of building snapshot and publish | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| action: | ||
| required: true | ||
| type: string | ||
| travis_tag: | ||
| required: true | ||
| type: string | ||
| secrets: | ||
| MAVEN_SIGNING_KEY_BASE64: | ||
| required: true | ||
| MAVEN_SIGNING_PASSPHRASE: | ||
| required: true | ||
| MAVEN_CENTRAL_USERNAME: | ||
| required: true | ||
| MAVEN_CENTRAL_PASSWORD: | ||
| required: true | ||
| jobs: | ||
| run_build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: set up JDK 8 | ||
| uses: actions/setup-java@v2 | ||
| with: | ||
| java-version: '8' | ||
| distribution: 'temurin' | ||
| cache: gradle | ||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
| - name: ${{ inputs.action }} | ||
| env: | ||
| 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 }} | ||
| run: TRAVIS_TAG=${{ inputs.travis_tag }} ./gradlew ${{ inputs.action }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,183 @@ | ||
|
|
||
| name: Java CI with Gradle | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| 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: | ||
| 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 | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| run: | | ||
| echo "SDK_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV | ||
| echo "TRAVIS_BRANCH=${{ github.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: java | ||
| BUILD_NUMBER: ${{ github.run_id }} | ||
| TESTAPP_BRANCH: master | ||
| GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }} | ||
| TRAVIS_EVENT_TYPE: ${{ github.event_name }} | ||
| GITHUB_CONTEXT: ${{ toJson(github) }} | ||
| TRAVIS_REPO_SLUG: ${{ github.repository }} | ||
| TRAVIS_PULL_REQUEST_SLUG: ${{ github.repository }} | ||
| UPSTREAM_REPO: ${{ github.repository }} | ||
| TRAVIS_COMMIT: ${{ github.sha }} | ||
| TRAVIS_PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} | ||
| TRAVIS_PULL_REQUEST: ${{ github.event.pull_request.number }} | ||
| UPSTREAM_SHA: ${{ github.sha }} | ||
| TRAVIS_COM_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 | ||
|
|
||
| fullstack_production_suite: | ||
| 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 | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| run: | | ||
| echo "SDK_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV | ||
| echo "TRAVIS_BRANCH=${{ github.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: java | ||
| FULLSTACK_TEST_REPO: ProdTesting | ||
| BUILD_NUMBER: ${{ github.run_id }} | ||
| TESTAPP_BRANCH: master | ||
| GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }} | ||
| TRAVIS_EVENT_TYPE: ${{ github.event_name }} | ||
| GITHUB_CONTEXT: ${{ toJson(github) }} | ||
| TRAVIS_REPO_SLUG: ${{ github.repository }} | ||
| TRAVIS_PULL_REQUEST_SLUG: ${{ github.repository }} | ||
| UPSTREAM_REPO: ${{ github.repository }} | ||
| TRAVIS_COMMIT: ${{ github.sha }} | ||
| TRAVIS_PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} | ||
| TRAVIS_PULL_REQUEST: ${{ github.event.pull_request.number }} | ||
| UPSTREAM_SHA: ${{ github.sha }} | ||
| TRAVIS_COM_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 | ||
| test: | ||
| runs-on: macos-latest | ||
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| jdk: [8, 9] | ||
| optimizely_default_parser: [GSON_CONFIG_PARSER, JACKSON_CONFIG_PARSER, JSON_CONFIG_PARSER, JSON_SIMPLE_CONFIG_PARSER] | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: set up JDK ${{ matrix.jdk }} | ||
| uses: AdoptOpenJDK/install-jdk@v1 | ||
| with: | ||
| version: ${{ matrix.jdk }} | ||
| architecture: x64 | ||
|
|
||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: Gradle cache | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }} | ||
|
|
||
| - name: run tests | ||
| id: unit_tests | ||
| env: | ||
| optimizely_default_parser: ${{ matrix.optimizely_default_parser }} | ||
| run: | | ||
| ./gradlew clean | ||
| ./gradlew exhaustiveTest | ||
| ./gradlew build | ||
| - name: Check on failures | ||
| if: steps.unit_tests.outcome != 'success' | ||
| run: | | ||
| cat /home/runner/java-sdk/core-api/build/reports/findbugs/main.html | ||
| cat /home/runner/java-sdk/core-api/build/reports/findbugs/test.html | ||
| - name: Check on success | ||
| if: steps.unit_tests.outcome == 'success' | ||
| run: | | ||
| ./gradlew coveralls uploadArchives --console plain | ||
|
|
||
| publish: | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| uses: optimizely/java-sdk/.github/workflows/build.yml@mnoman/gitAction | ||
| 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/java-sdk/.github/workflows/build.yml@mnoman/gitAction | ||
| 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 }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| name: Source clear | ||
|
|
||
| on: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we add master branch here. |
||
| schedule: | ||
| # Runs "weekly" | ||
| - cron: '0 0 * * 0' | ||
|
|
||
| jobs: | ||
| source_clear: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Source clear scan | ||
| env: | ||
| SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }} | ||
| run: curl -sSL https://download.sourceclear.com/ci.sh | bash -s – scan | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.