-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
a29f4b0
Added source clear and other java stages
NomanShoaib a27d10c
test
mnoman09 1e06bc9
test
mnoman09 83556cb
testing
mnoman09 72c9abf
testings
mnoman09 1316737
test
mnoman09 2504e08
added failure and success steps
mnoman09 84ed08f
Removing travis yml as all the actions are moved to git action
mnoman09 4c89536
Added build.yml reusable workflow for building and publishing
mnoman09 4b55c39
updated build.yml
mnoman09 1e41105
using reusable workflow
mnoman09 c01025a
test
mnoman09 dc7f868
changed mac os to ubuntu latest
mnoman09 aad83ff
added reusable workflow for integration and production suite
mnoman09 5b8b518
finalized integrationtest yml
mnoman09 4d56a25
using reusable workflow
mnoman09 a55e43b
test using event Name
mnoman09 864d388
passing event name
mnoman09 f05dbdc
fixed prod suite error
mnoman09 673d5df
Merge branch 'master' into mnoman/gitAction
mnoman09 7345965
fixed publishing tag issue
mnoman09 2c9f290
test
mnoman09 8889af9
test
mnoman09 d63a1de
test
mnoman09 087572f
fixed
mnoman09 9e54d58
added check to skip unit test step before publishing
mnoman09 f8863ec
Changed branch to master
mnoman09 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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 }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Reusable action of running integration of production suite | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
FULLSTACK_TEST_REPO: | ||
required: false | ||
type: string | ||
secrets: | ||
CI_USER_TOKEN: | ||
required: true | ||
TRAVIS_COM_TOKEN: | ||
required: true | ||
jobs: | ||
test: | ||
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: ${{ inputs.FULLSTACK_TEST_REPO }} | ||
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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
|
||
name: Java CI with Gradle | ||
|
||
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: | ||
uses: optimizely/java-sdk/.github/workflows/integration_test.yml@master | ||
secrets: | ||
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} | ||
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} | ||
|
||
fullstack_production_suite: | ||
uses: optimizely/java-sdk/.github/workflows/integration_test.yml@master | ||
with: | ||
FULLSTACK_TEST_REPO: ProdTesting | ||
secrets: | ||
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} | ||
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} | ||
|
||
test: | ||
if: startsWith(github.ref, 'refs/tags/') != true | ||
runs-on: ubuntu-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/') | ||
uses: optimizely/java-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/java-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 }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Source clear | ||
|
||
on: | ||
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add master branch here.