Skip to content
Draft
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
185 changes: 185 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: CI

on:
push:
branches: [master, edge]
pull_request:

env:
GO_VERSION: "1.24"

jobs:
check-go-generate:
runs-on: ubuntu-latest
container: owncloudci/golang:1.24
steps:
- uses: actions/checkout@v4
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- run: make go-generate && git diff --exit-code

unit-tests:
runs-on: ubuntu-latest
container: owncloudci/golang:1.24
steps:
- uses: actions/checkout@v4
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- run: apk update && apk add --no-cache inotify-tools
- run: make test
- uses: actions/upload-artifact@v4
if: always()
with:
name: coverage
path: coverage.out

build:
needs: [unit-tests]
runs-on: ubuntu-latest
container: owncloudci/golang:1.24
steps:
- uses: actions/checkout@v4
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- run: make dist

integration-tests:
needs: [unit-tests]
runs-on: ubuntu-latest
container: owncloudci/golang:1.24
services:
redis:
image: redis:6-alpine
env:
REDIS_DATABASES: 1
steps:
- uses: actions/checkout@v4
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- run: make test-integration
env:
REDIS_ADDRESS: redis:6379

litmus:
needs: [unit-tests]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
endpoint: [old-webdav, new-webdav, spaces-dav]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: python3 tests/acceptance/run-litmus.py --endpoint ${{ matrix.endpoint }}

cs3api-validator:
needs: [unit-tests]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
storage: [ocis, s3ng]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: python3 tests/acceptance/run-cs3api.py --storage ${{ matrix.storage }}

acceptance-tests-ocis:
needs: [unit-tests]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
part: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: shivammathur/setup-php@v2
with:
php-version: "8.4"
- run: python3 tests/acceptance/run-acceptance.py --storage ocis --total-parts 4 --run-part ${{ matrix.part }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: acceptance-ocis-part-${{ matrix.part }}
path: tmp/testrunner/tests/acceptance/output/

acceptance-tests-s3ng:
needs: [unit-tests]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
part: [1, 2, 3, 4, 5, 6]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: shivammathur/setup-php@v2
with:
php-version: "8.4"
- run: python3 tests/acceptance/run-acceptance.py --storage s3ng --total-parts 6 --run-part ${{ matrix.part }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: acceptance-s3ng-part-${{ matrix.part }}
path: tmp/testrunner/tests/acceptance/output/

acceptance-tests-posixfs:
needs: [unit-tests]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
part: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: shivammathur/setup-php@v2
with:
php-version: "8.4"
- run: sudo apt-get update && sudo apt-get install -y inotify-tools
- run: python3 tests/acceptance/run-acceptance.py --storage posixfs --total-parts 4 --run-part ${{ matrix.part }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: acceptance-posixfs-part-${{ matrix.part }}
path: tmp/testrunner/tests/acceptance/output/

ci-ok:
if: always()
needs:
- check-go-generate
- unit-tests
- build
- integration-tests
- litmus
- cs3api-validator
- acceptance-tests-ocis
- acceptance-tests-s3ng
- acceptance-tests-posixfs
runs-on: ubuntu-latest
steps:
- run: |
results=(
"${{ needs.check-go-generate.result }}"
"${{ needs.unit-tests.result }}"
"${{ needs.build.result }}"
"${{ needs.integration-tests.result }}"
"${{ needs.litmus.result }}"
"${{ needs.cs3api-validator.result }}"
"${{ needs.acceptance-tests-ocis.result }}"
"${{ needs.acceptance-tests-s3ng.result }}"
"${{ needs.acceptance-tests-posixfs.result }}"
)
for r in "${results[@]}"; do
if [[ "$r" != "success" && "$r" != "skipped" ]]; then
echo "FAILED: $r"
exit 1
fi
done
Loading
Loading