Skip to content

Commit e854db1

Browse files
authored
chore: Adjust build process (#1444)
1 parent c7d50d5 commit e854db1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+232
-140
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Autoupdate PR
2+
on:
3+
push:
4+
branches:
5+
- combined-sdk
6+
7+
jobs:
8+
update_pull_requests:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
with:
15+
token: ${{ secrets.DISPATCH_ACCESS_TOKEN }}
16+
17+
- name: Set up Git
18+
run: |
19+
git config --global user.name 'box-sdk-build'
20+
git config --global user.email '[email protected]'
21+
22+
- name: Fetch all branches and tags
23+
run: git fetch --prune --unshallow
24+
25+
- name: Auto update pull requests
26+
run: |
27+
PR_LIST=$(curl -s -H "Authorization: Bearer ${{ secrets.DISPATCH_ACCESS_TOKEN }}" "https://api.github.com/repos/$GITHUB_REPOSITORY/pulls?state=open" | jq -r '.[] | .head.ref')
28+
for pr_branch in $PR_LIST; do
29+
git checkout "$pr_branch"
30+
if git merge origin/combined-sdk; then
31+
git push
32+
else
33+
# Conflict occurred, resolve by keeping our changes
34+
git checkout --ours .
35+
git add .
36+
git commit -m "Auto resolve conflict by keeping our changes"
37+
git push
38+
fi
39+
done
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Integration tests sdk
2+
on:
3+
pull_request:
4+
branches:
5+
- combined-sdk
6+
jobs:
7+
core:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- name: Setup Java
13+
uses: actions/setup-java@v4
14+
with:
15+
distribution: 'temurin'
16+
java-version: '8'
17+
- name: All Tests
18+
if: startsWith(github.head_ref, 'codegen-release')
19+
env:
20+
JAVA_COLLABORATOR_ID: ${{ secrets.JAVA_COLLABORATOR_ID }}
21+
JAVA_COLLABORATOR: ${{ secrets.JAVA_COLLABORATOR }}
22+
JAVA_ENTERPRISE_ID: ${{ secrets.JAVA_ENTERPRISE_ID }}
23+
JAVA_JWT_CONFIG: ${{ secrets.JAVA_JWT_CONFIG }}
24+
JAVA_USER_ID: ${{ secrets.JAVA_USER_ID }}
25+
run: ./gradlew integrationTest --stacktrace
26+
- name: Smoke Tests
27+
if: "!startsWith(github.head_ref, 'codegen-release')"
28+
env:
29+
JAVA_COLLABORATOR_ID: ${{ secrets.JAVA_COLLABORATOR_ID }}
30+
JAVA_COLLABORATOR: ${{ secrets.JAVA_COLLABORATOR }}
31+
JAVA_ENTERPRISE_ID: ${{ secrets.JAVA_ENTERPRISE_ID }}
32+
JAVA_JWT_CONFIG: ${{ secrets.JAVA_JWT_CONFIG }}
33+
JAVA_USER_ID: ${{ secrets.JAVA_USER_ID }}
34+
run: ./gradlew smokeTest --stacktrace
Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
name: Build and Test daily (sdk-gen)
1+
name: Integration tests sdkgen
22
on:
3-
schedule:
4-
- cron: "20 1 * * 1-5"
3+
pull_request:
4+
branches:
5+
- combined-sdk
56
jobs:
67
build-and-test:
78
runs-on: ubuntu-latest
89
strategy:
910
max-parallel: 1
1011
matrix:
11-
distribution: ["zulu", "temurin"]
12-
java: ["8", "17"]
12+
distribution: ['zulu', 'temurin']
13+
java: ['8', '17']
1314
name: Java ${{ matrix.java }} (${{ matrix.distribution }})
1415
steps:
1516
- name: Checkout
1617
uses: actions/checkout@v4
17-
with:
18-
ref: sdk-gen
1918
- name: Setup Java
2019
uses: actions/setup-java@v4
2120
with:
2221
distribution: ${{ matrix.distribution }}
2322
java-version: ${{ matrix.java }}
24-
cache: "gradle"
23+
cache: 'gradle'
2524
- name: All Tests
25+
if: startsWith(github.head_ref, 'codegen-release')
2626
env:
2727
JWT_CONFIG_BASE_64: ${{ secrets.JWT_CONFIG_BASE_64 }}
2828
ADMIN_USER_ID: ${{ secrets.ADMIN_USER_ID }}
@@ -40,28 +40,13 @@ jobs:
4040
SLACK_AUTOMATION_USER_ID: ${{ secrets.SLACK_AUTOMATION_USER_ID }}
4141
SLACK_ORG_ID: ${{ secrets.SLACK_ORG_ID }}
4242
SLACK_PARTNER_ITEM_ID: ${{ secrets.SLACK_PARTNER_ITEM_ID }}
43-
run: ./gradlew check --stacktrace
44-
- name: Coverage
43+
run: ./gradlew integrationTestGen --stacktrace
44+
- name: Smoke Tests
45+
if: "!startsWith(github.head_ref, 'codegen-release')"
4546
env:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
run: ./gradlew jacocoTestReport coverallsJacoco
48-
notify:
49-
name: Send Slack Notification
50-
runs-on: ubuntu-latest
51-
needs: [build-and-test]
52-
if: always()
53-
steps:
54-
- name: Send Slack Notification
55-
env:
56-
SLACK_WEBHOOK_TEST_NOTIFICATION_URL: ${{ secrets.SLACK_WEBHOOK_TEST_NOTIFICATION_URL }}
57-
BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
58-
run: |
59-
if [ "${{ needs.build-and-test.result }}" != "success" ]; then
60-
STATUS="Failure ❌"
61-
else
62-
STATUS="Success ✅"
63-
fi
64-
65-
curl -X POST -H "Content-Type: application/json" \
66-
--data "{\"text\":\"<${BUILD_URL}|Daily Tests Job> in *${GITHUB_REPOSITORY}* finished with status: ${STATUS}\"}" \
67-
"$SLACK_WEBHOOK_TEST_NOTIFICATION_URL"
47+
JWT_CONFIG_BASE_64: ${{ secrets.JWT_CONFIG_BASE_64 }}
48+
CLIENT_ID: ${{ secrets.CLIENT_ID }}
49+
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
50+
USER_ID: ${{ secrets.USER_ID }}
51+
ENTERPRISE_ID: ${{ secrets.ENTERPRISE_ID }}
52+
run: ./gradlew smokeTestGen --stacktrace

.github/workflows/integration-tests.yml

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

.github/workflows/releases.yml

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

.github/workflows/semantic-pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- opened
77
- edited
88
- synchronize
9+
branches:
10+
- combined-sdk
911

1012
jobs:
1113
main:

.github/workflows/spell-check-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: spell-check-lint
22
on:
33
pull_request_target:
4-
types: [ opened, synchronize, edited ]
4+
types: [opened, synchronize, edited]
55
branches:
6-
- main
6+
- combined-sdk
77
jobs:
88
spellcheck-request-title:
99
runs-on: ubuntu-latest
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: build-main
1+
name: Unit tests and Coverage
22
on:
33
pull_request:
44
types: [ opened, synchronize ]
55
push:
66
branches:
7-
- main
7+
- combined-sdk
88
jobs:
99
build-and-test:
1010
runs-on: ubuntu-latest
@@ -24,7 +24,9 @@ jobs:
2424
cache: 'gradle'
2525
- name: Build and test
2626
run: ./gradlew check --stacktrace
27-
- name: Coverage
27+
- name: Generate JaCoCo report
28+
run: ./gradlew jacocoTestReport --stacktrace
29+
- name: Upload coverage to Coveralls
2830
env:
2931
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
run: ./gradlew jacocoTestReport coverallsJacoco
32+
run: ./gradlew coverallsJacoco --stacktrace

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ The most important change this release includes is the replacement of the HTTP l
288288
* `BoxEvent.Type` is replaced with `EventType`
289289
* Removing deprecated methods from `BoxFile`, `BoxFileVersionRetention`, `BoxFolder`, `BoxGroup`, `BoxGroupMembership`,`BoxItem`, `BoxRetentionPolicy`, `BoxTask`, `BoxUser`, `BoxWebLink`, `EventLog`, `Metadata` and `MetadataTemplate`.
290290

291-
Migration details can be found [here](doc/upgrades/3.x.x%20to%204.x.x.md).
291+
Migration details can be found [here](migration-guides/3.x.x%20to%204.x.x.md).
292292

293293
### New Features and Enhancements:
294294

0 commit comments

Comments
 (0)