File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ name: Alioss Integration Tests
22
33on :
44 workflow_dispatch :
5+ inputs :
6+ pr_ref :
7+ description : ' SHA of the PR head commit (for fork PRs)'
8+ required : false
9+ default : ' '
510 pull_request :
611 push :
712 branches :
2328 steps :
2429 - name : Checkout code
2530 uses : actions/checkout@v7
31+ with :
32+ ref : ${{ inputs.pr_ref || github.sha }}
2633 - name : Set up Go
2734 uses : actions/setup-go@v6
2835 with :
Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ name: Azurebs Integration Tests
22
33on :
44 workflow_dispatch :
5+ inputs :
6+ pr_ref :
7+ description : ' SHA of the PR head commit (for fork PRs)'
8+ required : false
9+ default : ' '
510 pull_request :
611 push :
712 branches :
2328 steps :
2429 - name : Checkout code
2530 uses : actions/checkout@v7
31+ with :
32+ ref : ${{ inputs.pr_ref || github.sha }}
2633 - name : Set up Go
2734 uses : actions/setup-go@v6
2835 with :
Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ name: DAV Integration Tests
22
33on :
44 workflow_dispatch :
5+ inputs :
6+ pr_ref :
7+ description : ' SHA of the PR head commit (for fork PRs)'
8+ required : false
9+ default : ' '
510 pull_request :
611 push :
712 branches :
2328 steps :
2429 - name : Checkout code
2530 uses : actions/checkout@v7
31+ with :
32+ ref : ${{ inputs.pr_ref || github.sha }}
2633
2734 - name : Set up Go
2835 uses : actions/setup-go@v6
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ permissions:
99jobs :
1010 auto-merge :
1111 runs-on : ubuntu-latest
12- if : ${{ github.actor == 'dependabot[bot]' }}
12+ if : github.actor == 'dependabot[bot]'
1313 steps :
1414 - name : Enable auto-merge
1515 run : gh pr merge --auto --rebase "${{ github.event.pull_request.number }}"
Original file line number Diff line number Diff line change 1+ name : Trigger integration tests for fork PRs
2+
3+ on :
4+ issue_comment :
5+ types : [created]
6+
7+ permissions :
8+ pull-requests : write
9+
10+ jobs :
11+ trigger :
12+ name : Trigger integration tests
13+ runs-on : ubuntu-latest
14+ if : |
15+ github.event.issue.pull_request != null &&
16+ contains(github.event.comment.body, '/run-integration')
17+ steps :
18+ - name : Check commenter has write permission
19+ run : |
20+ permission=$(gh api repos/$GITHUB_REPOSITORY/collaborators/${{ github.actor }}/permission --jq '.permission')
21+ if [[ "$permission" != "write" && "$permission" != "admin" ]]; then
22+ echo "${{ github.actor }} does not have write permission (got: $permission)"
23+ exit 1
24+ fi
25+
26+ - name : Get PR head SHA and check for fork
27+ id : pr
28+ run : |
29+ pr=$(gh pr view ${{ github.event.issue.number }} --json headRefOid,isCrossRepository)
30+ read -r ref is_fork < <(echo "$pr" | jq -r '[.headRefOid, (.isCrossRepository | tostring)] | @tsv')
31+ if [[ "$is_fork" == "false" ]]; then
32+ echo "This command is only needed for fork PRs. Integration tests run automatically for PRs from this repository."
33+ exit 1
34+ fi
35+ echo "ref=$ref" >> $GITHUB_OUTPUT
36+
37+ - name : Add reaction to comment
38+ run : |
39+ gh api --method POST \
40+ repos/$GITHUB_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \
41+ -f content=rocket
42+
43+ - name : Trigger integration tests
44+ run : |
45+ for workflow in s3-integration.yml gcs-integration.yml alioss-integration.yml azurebs-integration.yml dav-integration.yml; do
46+ gh workflow run "$workflow" --ref ${{ github.event.repository.default_branch }} -f pr_ref=${{ steps.pr.outputs.ref }} &
47+ done
48+ wait
Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ name: GCS Integration Tests
22
33on :
44 workflow_dispatch :
5+ inputs :
6+ pr_ref :
7+ description : ' SHA of the PR head commit (for fork PRs)'
8+ required : false
9+ default : ' '
510 pull_request :
611 push :
712 branches :
2227 (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
2328 steps :
2429 - name : Checkout code
25- uses : actions/checkout@v7
30+ uses : actions/checkout@v7
31+ with :
32+ ref : ${{ inputs.pr_ref || github.sha }}
2633 - name : Set up Go
2734 uses : actions/setup-go@v6
2835 with :
5764 (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
5865 steps :
5966 - name : Checkout code
60- uses : actions/checkout@v7
67+ uses : actions/checkout@v7
68+ with :
69+ ref : ${{ inputs.pr_ref || github.sha }}
6170 - name : Set up Go
6271 uses : actions/setup-go@v6
6372 with :
Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ name: S3 Integration Tests
22
33on :
44 workflow_dispatch :
5+ inputs :
6+ pr_ref :
7+ description : ' SHA of the PR head commit (for fork PRs)'
8+ required : false
9+ default : ' '
510 pull_request :
611 push :
712 branches :
2732 steps :
2833 - name : Checkout code
2934 uses : actions/checkout@v7
35+ with :
36+ ref : ${{ inputs.pr_ref || github.sha }}
3037
3138 - name : Set up test environment
3239 uses : ./.github/actions/go-test-bootstrap
@@ -113,6 +120,8 @@ jobs:
113120 steps :
114121 - name : Checkout code
115122 uses : actions/checkout@v7
123+ with :
124+ ref : ${{ inputs.pr_ref || github.sha }}
116125
117126 - name : Set up test environment
118127 uses : ./.github/actions/go-test-bootstrap
@@ -156,6 +165,8 @@ jobs:
156165 steps :
157166 - name : Checkout code
158167 uses : actions/checkout@v7
168+ with :
169+ ref : ${{ inputs.pr_ref || github.sha }}
159170
160171 - name : Set up test environment
161172 uses : ./.github/actions/go-test-bootstrap
You can’t perform that action at this time.
0 commit comments