8000 chore: removed travis yml and added git action support (#469) · optimizely/java-sdk@19e4d64 · GitHub
[go: up one dir, main page]

Skip to content

Commit 19e4d64

Browse files
mnoman09jaeopt
authored andcommitted
chore: removed travis yml and added git action support (#469)
1 parent 29dcf99 commit 19e4d64

File tree

5 files changed

+228
-92
lines changed

5 files changed

+228
-92
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Reusable action of building snapshot and publish
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
action:
7+
required: true
8+
type: string
9+
travis_tag:
10+
required: true
11+
type: string
12+
secrets:
13+
MAVEN_SIGNING_KEY_BASE64:
14+
required: true
15+
MAVEN_SIGNING_PASSPHRASE:
16+
required: true
17+
MAVEN_CENTRAL_USERNAME:
18+
required: true
19+
MAVEN_CENTRAL_PASSWORD:
20+
required: true
21+
jobs:
22+
run_build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: set up JDK 8
27+
uses: actions/setup-java@v2
28+
with:
29+
java-version: '8'
30+
distribution: 'temurin'
31+
cache: gradle
32+
- name: Grant execute permission for gradlew
33+
run: chmod +x gradlew
34+
- name: ${{ inputs.action }}
35+
env:
36+
MAVEN_SIGNING_KEY_BASE64: ${{ secrets.MAVEN_SIGNING_KEY_BASE64 }}
37+
MAVEN_SIGNING_PASSPHRASE: ${{ secrets.MAVEN_SIGNING_PASSPHRASE }}
38+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
39+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
40+
run: TRAVIS_TAG=${{ inputs.travis_tag }} ./gradlew ${{ inputs.action }}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Reusable action of running integration of production suite
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
FULLSTACK_TEST_REPO:
7+
required: false
8+
type: string
9+
secrets:
10+
CI_USER_TOKEN:
11+
required: true
12+
TRAVIS_COM_TOKEN:
13+
required: true
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
with:
20+
# You should create a personal access token and store it in your repository
21+
token: ${{ secrets.CI_USER_TOKEN }}
22+
repository: 'optimizely/travisci-tools'
23+
path: 'home/runner/travisci-tools'
24+
ref: 'master'
25+
- name: set SDK Branch if PR
26+
if: ${{ github.event_name == 'pull_request' }}
27+
run: |
28+
echo "SDK_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
29+
echo "TRAVIS_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
30+
- name: set SDK Branch if not pull request
31+
if: ${{ github.event_name != 'pull_request' }}
32+
run: |
33+
echo "SDK_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
34+
echo "TRAVIS_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
35+
- name: Trigger build
36+
env:
37+
SDK: java
38+
FULLSTACK_TEST_REPO: ${{ inputs.FULLSTACK_TEST_REPO }}
39+
BUILD_NUMBER: ${{ github.run_id }}
40+
TESTAPP_BRANCH: master
41+
GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }}
42+
TRAVIS_EVENT_TYPE: ${{ github.event_name }}
43+
GITHUB_CONTEXT: ${{ toJson(github) }}
44+
TRAVIS_REPO_SLUG: ${{ github.repository }}
45+
TRAVIS_PULL_REQUEST_SLUG: ${{ github.repository }}
46+
UPSTREAM_REPO: ${{ github.repository }}
47+
TRAVIS_COMMIT: ${{ github.sha }}
48+
TRAVIS_PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }}
49+
TRAVIS_PULL_REQUEST: ${{ github.event.pull_request.number }}
50+
UPSTREAM_SHA: ${{ github.sha }}
51+
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }}
52+
EVENT_MESSAGE: ${{ github.event.message }}
53+
HOME: 'home/runner'
54+
run: |
55+
echo "$GITHUB_CONTEXT"
56+
home/runner/travisci-tools/trigger-script-with-status-update.sh

.github/workflows/java.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
2+
name: Java CI with Gradle
3+
4+
on:
5+
push:
6+
branches: [ master ]
7+
tags:
8+
- '*'
9+
pull_request:
10+
branches: [ master ]
11+
workflow_dispatch:
12+
inputs:
13+
SNAPSHOT:
14+
type: boolean
15+
description: Set SNAPSHOT true to publish
16+
17+
jobs:
18+
lint_markdown_files:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Ruby
23+
uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: '2.6'
26+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
27+
- name: Install gem
28+
run: |
29+
gem install awesome_bot
30+
- name: Run tests
31+
run: find . -type f -name '*.md' -exec awesome_bot {} \;
32+
33+
integration_tests:
34+
uses: optimizely/java-sdk/.github/workflows/integration_test.yml@master
35+
secrets:
36+
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }}
37+
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }}
38+
39+
fullstack_production_suite:
40+
uses: optimizely/java-sdk/.github/workflows/integration_test.yml@master
41+
with:
42+
FULLSTACK_TEST_REPO: ProdTesting
43+
secrets:
44+
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }}
45+
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }}
46+
47+
test:
48+
if: startsWith(github.ref, 'refs/tags/') != true
49+
runs-on: ubuntu-latest
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
jdk: [8, 9]
54+
optimizely_default_parser: [GSON_CONFIG_PARSER, JACKSON_CONFIG_PARSER, JSON_CONFIG_PARSER, JSON_SIMPLE_CONFIG_PARSER]
55+
steps:
56+
- name: checkout
57+
uses: actions/checkout@v2
58+
59+
- name: set up JDK ${{ matrix.jdk }}
60+
uses: AdoptOpenJDK/install-jdk@v1
61+
with:
62+
version: ${{ matrix.jdk }}
63+
architecture: x64
64+
65+
- name: Grant execute permission for gradlew
66+
run: chmod +x gradlew
67+
68+
- name: Gradle cache
69+
uses: actions/cache@v2
70+
with:
71+
path: |
72+
~/.gradle/caches
73+
~/.gradle/wrapper
74+
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
75+
76+
- name: run tests
77+
id: unit_tests
78+
env:
79+
optimizely_default_parser: ${{ matrix.optimizely_default_parser }}
80+
run: |
81+
./gradlew clean
82+
./gradlew exhaustiveTest
83+
./gradlew build
84+
- name: Check on failures
85+
if: steps.unit_tests.outcome != 'success'
86+
run: |
87+
cat /home/runner/java-sdk/core-api/build/reports/findbugs/main.html
88+
cat /home/runner/java-sdk/core-api/build/reports/findbugs/test.html
89+
- name: Check on success
90+
if: steps.unit_tests.outcome == 'success'
91+
run: |
92+
./gradlew coveralls uploadArchives --console plain
93+
94+
publish:
95+
if: startsWith(github.ref, 'refs/tags/')
96+
uses: optimizely/java-sdk/.github/workflows/build.yml@master
97+
with:
98+
action: ship
99+
travis_tag: ${GITHUB_REF#refs/*/}
100+
secrets:
101+
MAVEN_SIGNING_KEY_BASE64: ${{ secrets.MAVEN_SIGNING_KEY_BASE64 }}
102+
MAVEN_SIGNING_PASSPHRASE: ${{ secrets.MAVEN_SIGNING_PASSPHRASE }}
103+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
104+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
105+
106+
snapshot:
107+
if: ${{ github.event.inputs.SNAPSHOT == 'true' && github.event_name == 'workflow_dispatch' }}
108+
uses: optimizely/java-sdk/.github/workflows/build.yml@master
109+
with:
110+
action: ship
111+
travis_tag: BB-SNAPSHOT
112+
secrets:
113+
MAVEN_SIGNING_KEY_BASE64: ${{ secrets.MAVEN_SIGNING_KEY_BASE64 }}
114+
MAVEN_SIGNING_PASSPHRASE: ${{ secrets.MAVEN_SIGNING_PASSPHRASE }}
115+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
116+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Source clear
2+
3+
on:
4+
schedule:
5+
# Runs "weekly"
6+
- cron: '0 0 * * 0'
7+
8+
jobs:
9+
source_clear:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Source clear scan
14+
env:
15+
SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }}
16+
run: curl -sSL https://download.sourceclear.com/ci.sh | bash -s – scan

.travis.yml

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0