Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/alioss-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Alioss Integration Tests

on:
workflow_dispatch:
inputs:
pr_ref:
description: 'SHA of the PR head commit (for fork PRs)'
required: false
default: ''
pull_request:
paths:
- ".github/workflows/alioss-integration.yml"
- "alioss/**"
- "go.mod"
- "go.sum"
push:
branches:
- main
Expand All @@ -28,6 +28,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
ref: ${{ inputs.pr_ref || github.sha }}
- name: Set up Go
uses: actions/setup-go@v6
with:
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/azurebs-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Azurebs Integration Tests

on:
workflow_dispatch:
inputs:
pr_ref:
description: 'SHA of the PR head commit (for fork PRs)'
required: false
default: ''
pull_request:
paths:
- ".github/workflows/azurebs-integration.yml"
- "azurebs/**"
- "go.mod"
- "go.sum"
push:
branches:
- main
Expand All @@ -28,6 +28,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
ref: ${{ inputs.pr_ref || github.sha }}
- name: Set up Go
uses: actions/setup-go@v6
with:
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/dav-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: DAV Integration Tests

on:
workflow_dispatch:
inputs:
pr_ref:
description: 'SHA of the PR head commit (for fork PRs)'
required: false
default: ''
pull_request:
paths:
- ".github/workflows/dav-integration.yml"
- "dav/**"
- "go.mod"
- "go.sum"
push:
branches:
- main
Expand All @@ -28,6 +28,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
ref: ${{ inputs.pr_ref || github.sha }}

- name: Set up Go
uses: actions/setup-go@v6
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Dependabot auto-merge

on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Enable auto-merge
run: gh pr merge --auto --rebase "${{ github.event.pull_request.number }}"
48 changes: 48 additions & 0 deletions .github/workflows/fork-integration-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Trigger integration tests for fork PRs

on:
issue_comment:
types: [created]

permissions:
pull-requests: write

jobs:
trigger:
name: Trigger integration tests
runs-on: ubuntu-latest
if: |
github.event.issue.pull_request != null &&
contains(github.event.comment.body, '/run-integration')
steps:
- name: Check commenter has write permission
run: |
permission=$(gh api repos/$GITHUB_REPOSITORY/collaborators/${{ github.actor }}/permission --jq '.permission')
if [[ "$permission" != "write" && "$permission" != "admin" ]]; then
echo "${{ github.actor }} does not have write permission (got: $permission)"
exit 1
fi

- name: Get PR head SHA and check for fork
id: pr
run: |
pr=$(gh pr view ${{ github.event.issue.number }} --json headRefOid,isCrossRepository)
read -r ref is_fork < <(echo "$pr" | jq -r '[.headRefOid, (.isCrossRepository | tostring)] | @tsv')
if [[ "$is_fork" == "false" ]]; then
echo "This command is only needed for fork PRs. Integration tests run automatically for PRs from this repository."
exit 1
fi
echo "ref=$ref" >> $GITHUB_OUTPUT

- name: Add reaction to comment
run: |
gh api --method POST \
repos/$GITHUB_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \
-f content=rocket

- name: Trigger integration tests
run: |
for workflow in s3-integration.yml gcs-integration.yml alioss-integration.yml azurebs-integration.yml dav-integration.yml; do
gh workflow run "$workflow" --ref ${{ github.event.repository.default_branch }} -f pr_ref=${{ steps.pr.outputs.ref }} &
done
wait
18 changes: 11 additions & 7 deletions .github/workflows/gcs-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: GCS Integration Tests

on:
workflow_dispatch:
inputs:
pr_ref:
description: 'SHA of the PR head commit (for fork PRs)'
required: false
default: ''
pull_request:
paths:
- ".github/workflows/gcs-integration.yml"
- "gcs/**"
- "go.mod"
- "go.sum"
push:
branches:
- "main"
Expand All @@ -27,7 +27,9 @@ jobs:
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@v7
with:
ref: ${{ inputs.pr_ref || github.sha }}
- name: Set up Go
uses: actions/setup-go@v6
with:
Expand Down Expand Up @@ -62,7 +64,9 @@ jobs:
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@v7
with:
ref: ${{ inputs.pr_ref || github.sha }}
- name: Set up Go
uses: actions/setup-go@v6
with:
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/s3-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: S3 Integration Tests

on:
workflow_dispatch:
inputs:
pr_ref:
description: 'SHA of the PR head commit (for fork PRs)'
required: false
default: ''
pull_request:
paths:
- ".github/workflows/s3-integration.yml"
- "s3/**"
- "go.mod"
- "go.sum"
push:
branches:
- main
Expand All @@ -32,6 +32,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
ref: ${{ inputs.pr_ref || github.sha }}

- name: Set up test environment
uses: ./.github/actions/go-test-bootstrap
Expand Down Expand Up @@ -118,6 +120,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
ref: ${{ inputs.pr_ref || github.sha }}

- name: Set up test environment
uses: ./.github/actions/go-test-bootstrap
Expand Down Expand Up @@ -161,6 +165,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
ref: ${{ inputs.pr_ref || github.sha }}

- name: Set up test environment
uses: ./.github/actions/go-test-bootstrap
Expand Down
Loading