Skip to content

Commit ba3863e

Browse files
authored
Sync github actions (#5695)
* Automate post-release change log merging * wording * rearrange * wording * Follow general template * Update RELEASING * Update RELEASING * Update RELEASING * Sync github actions * more * more * Remove outdated comment * Updates * sync * more
1 parent c5f677e commit ba3863e

33 files changed

+431
-353
lines changed

.github/scripts/markdown_link_check_config.json .github/scripts/markdown-link-check-config.json

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
22
"ignorePatterns": [
3-
{
4-
"pattern": "^https://github\\.com/open-telemetry/opentelemetry-java-instrumentation/pull/"
5-
},
63
{
74
"pattern": "^https://mvnrepository\\.com/artifact/io\\.opentelemetry$"
85
},

.github/workflows/backport-pull-request.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Backport a pull request
22
on:
33
workflow_dispatch:
44
inputs:
5-
pr:
5+
number:
66
description: "The pull request # to backport"
77
required: true
88

@@ -12,27 +12,27 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v3
1414
with:
15-
# need full tree in order to do cherry-pick
15+
# history is needed in order to do cherry-pick
1616
fetch-depth: 0
1717

18-
- name: Setup git name
18+
- name: Set up git name
1919
run: |
2020
git config user.name opentelemetry-java-bot
2121
git config user.email [email protected]
2222
2323
- name: Create pull request
2424
env:
25+
NUMBER: ${{ github.event.inputs.number }}
2526
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26-
PR: ${{ github.event.inputs.pr }}
2727
run: |
28-
commit=$(gh pr view $PR --json mergeCommit --jq .mergeCommit.oid)
29-
title=$(gh pr view $PR --json title --jq .title)
30-
url=$(gh pr view $PR --json url --jq .url)
28+
commit=$(gh pr view $NUMBER --json mergeCommit --jq .mergeCommit.oid)
29+
title=$(gh pr view $NUMBER --json title --jq .title)
30+
url=$(gh pr view $NUMBER --json url --jq .url)
3131
3232
git cherry-pick $commit
33-
git push origin HEAD:backport-$PR-to-$GITHUB_REF_NAME
33+
git push origin HEAD:backport-$NUMBER-to-$GITHUB_REF_NAME
3434
3535
gh pr create --title "[$GITHUB_REF_NAME] $title" \
36-
--body "Clean cherry-pick of #$PR to the $GITHUB_REF_NAME branch." \
37-
--head backport-$PR-to-$GITHUB_REF_NAME \
36+
--body "Clean cherry-pick of #$NUMBER to the $GITHUB_REF_NAME branch." \
37+
--head backport-$NUMBER-to-$GITHUB_REF_NAME \
3838
--base $GITHUB_REF_NAME
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Nightly (--no-build-cache)
1+
name: Build (daily, --no-build-cache)
22

33
on:
44
schedule:
@@ -7,8 +7,8 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build:
11-
uses: ./.github/workflows/reusable-build.yml
10+
assemble:
11+
uses: ./.github/workflows/reusable-assemble.yml
1212
with:
1313
no-build-cache: true
1414
secrets:
@@ -21,7 +21,7 @@ jobs:
2121
secrets:
2222
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
2323

24-
testLatestDeps:
24+
test-latest-deps:
2525
uses: ./.github/workflows/reusable-test-latest-deps.yml
2626
with:
2727
no-build-cache: true
@@ -35,19 +35,29 @@ jobs:
3535
secrets:
3636
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
3737

38-
# muzzle is intentionally not included in the nightly-no-cache build because
39-
# it doesn't use gradle cache anyways and so is already covered by the normal nightly build
38+
# muzzle is not included here because it doesn't use gradle cache anyway and so is already covered
39+
# by the normal daily build
40+
41+
gradle-plugins:
42+
uses: ./.github/workflows/reusable-gradle-plugins.yml
43+
with:
44+
no-build-cache: true
4045

4146
examples:
4247
uses: ./.github/workflows/reusable-examples.yml
4348
with:
4449
no-build-cache: true
4550

46-
# markdown-link-check is intentionally not included in the nightly-no-cache build because
47-
# it doesn't use gradle cache anyways and so is already covered by the normal nightly build
48-
49-
issue:
50-
name: Open issue on failure
51-
needs: [ build, test, testLatestDeps, smoke-test, examples ]
51+
# markdown-link-check and misspell-check are not included here because they don't use gradle cache
52+
# anyway and so are already covered by the normal daily build
53+
54+
open-issue-on-failure:
55+
needs:
56+
- assemble
57+
- test
58+
- test-latest-deps
59+
- smoke-test
60+
- gradle-plugins
61+
- examples
5262
if: failure()
5363
uses: ./.github/workflows/reusable-create-issue-for-failure.yml
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Nightly
1+
name: Build (daily)
22

33
on:
44
schedule:
@@ -7,8 +7,8 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build:
11-
uses: ./.github/workflows/reusable-build.yml
10+
assemble:
11+
uses: ./.github/workflows/reusable-assemble.yml
1212
secrets:
1313
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
1414
GE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
@@ -21,7 +21,7 @@ jobs:
2121
GE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
2222
GE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
2323

24-
testLatestDeps:
24+
test-latest-deps:
2525
uses: ./.github/workflows/reusable-test-latest-deps.yml
2626
secrets:
2727
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
@@ -38,37 +38,28 @@ jobs:
3838
muzzle:
3939
uses: ./.github/workflows/reusable-muzzle.yml
4040

41+
gradle-plugins:
42+
uses: ./.github/workflows/reusable-gradle-plugins.yml
43+
4144
examples:
4245
uses: ./.github/workflows/reusable-examples.yml
4346

4447
markdown-link-check:
45-
runs-on: ubuntu-latest
46-
steps:
47-
- uses: actions/checkout@v3
48-
49-
- name: Check markdown links
50-
run: |
51-
npm install -g markdown-link-check
52-
find . -type f \
53-
-name '*.md' \
54-
-not -path './.github/*' \
55-
-not -path './node_modules/*' \
56-
-print0 \
57-
| xargs -0 -n1 markdown-link-check --config .github/scripts/markdown_link_check_config.json
58-
59-
markdown-misspell-check:
60-
runs-on: ubuntu-latest
61-
steps:
62-
- uses: actions/checkout@v3
48+
uses: ./.github/workflows/reusable-markdown-link-check.yml
6349

64-
- name: Check markdown for common misspellings
65-
run: |
66-
curl -L -o ./install-misspell.sh https://git.io/misspell
67-
sh ./install-misspell.sh
68-
./bin/misspell -error ./**/*
50+
misspell-check:
51+
uses: ./.github/workflows/reusable-misspell-check.yml
6952

70-
issue:
71-
name: Open issue on failure
72-
needs: [ build, test, testLatestDeps, smoke-test, examples, markdown-link-check, markdown-misspell-check ]
53+
open-issue-on-failure:
54+
needs:
55+
- assemble
56+
- test
57+
- test-latest-deps
58+
- smoke-test
59+
- muzzle
60+
- gradle-plugins
61+
- examples
62+
- markdown-link-check
63+
- misspell-check
7364
if: failure()
7465
uses: ./.github/workflows/reusable-create-issue-for-failure.yml

.github/workflows/pr.yml .github/workflows/build-pull-request.yml

+49-20
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
name: PR
1+
name: Build pull request
22

3-
on: pull_request
3+
on:
4+
pull_request:
45

56
concurrency:
67
group: ci-${{ github.event.pull_request.number }}
78
cancel-in-progress: true
89

910
jobs:
10-
build:
11-
uses: ./.github/workflows/reusable-build.yml
11+
assemble:
12+
uses: ./.github/workflows/reusable-assemble.yml
1213
with:
1314
cache-read-only: true
1415

@@ -17,8 +18,8 @@ jobs:
1718
with:
1819
cache-read-only: true
1920

20-
testLatestDeps:
21-
# testLatestDeps is not included in the PR workflow by default
21+
test-latest-deps:
22+
# test-latest-deps is not included in the PR workflow by default
2223
# because any time a new library version is released to maven central
2324
# it can fail due to test code incompatibility with the new library version,
2425
# or due to slight changes in emitted telemetry, which can be confusing for contributors
@@ -52,35 +53,63 @@ jobs:
5253
with:
5354
cache-read-only: true
5455

56+
gradle-plugins:
57+
uses: ./.github/workflows/reusable-gradle-plugins.yml
58+
with:
59+
no-build-cache: true
60+
5561
examples:
5662
uses: ./.github/workflows/reusable-examples.yml
5763
with:
5864
cache-read-only: true
5965

60-
# markdown-link-check is not included in the PR build because links to external urls can break at
61-
# any time, which can be confusing for contributors
66+
# this is not a required check to avoid blocking pull requests if external links break
67+
markdown-link-check:
68+
uses: ./.github/workflows/reusable-markdown-link-check.yml
69+
70+
# this is not a required check to avoid blocking pull requests if new misspellings are added
71+
# to the misspell dictionary
72+
misspell-check:
73+
uses: ./.github/workflows/reusable-misspell-check.yml
6274

63-
markdown-misspell-check:
75+
required-status-check:
76+
needs:
77+
- assemble
78+
- test
79+
- smoke-test
80+
- muzzle
81+
- gradle-plugins
82+
- examples
6483
runs-on: ubuntu-latest
84+
if: always()
6585
steps:
66-
- uses: actions/checkout@v3
67-
68-
- name: Check markdown for common misspellings
69-
run: |
70-
curl -L -o ./install-misspell.sh https://git.io/misspell
71-
sh ./install-misspell.sh
72-
./bin/misspell -error ./**/*
86+
- if: |
87+
needs.assemble.result != 'success' ||
88+
needs.test.result != 'success' ||
89+
needs.smoke-test.result != 'success' ||
90+
needs.muzzle.result != 'success' ||
91+
needs.gradle-plugins.result != 'success' ||
92+
needs.examples.result != 'success'
93+
run: exit 1
7394
95+
# TODO (trask) this is just to avoid disruption for existing PRs
96+
# remove this and change required check to above once existing PRs are merged
7497
accept-pr:
75-
needs: [ build, test, smoke-test, muzzle, examples, markdown-misspell-check ]
98+
needs:
99+
- assemble
100+
- test
101+
- smoke-test
102+
- muzzle
103+
- gradle-plugins
104+
- examples
76105
runs-on: ubuntu-latest
77106
if: always()
78107
steps:
79108
- if: |
80-
needs.build.result != 'success' ||
109+
needs.assemble.result != 'success' ||
81110
needs.test.result != 'success' ||
82111
needs.smoke-test.result != 'success' ||
83112
needs.muzzle.result != 'success' ||
84-
needs.examples.result != 'success' ||
85-
needs.markdown-misspell-check.result != 'success'
113+
needs.gradle-plugins.result != 'success' ||
114+
needs.examples.result != 'success'
86115
run: exit 1

0 commit comments

Comments
 (0)