gitlab-push #45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Plugin Worker Tests (GitLab)" | |
| on: | |
| repository_dispatch: | |
| types: | |
| - gitlab-push | |
| - gitlab-merge-request | |
| workflow_dispatch: | |
| inputs: | |
| gitlab_branch: | |
| description: 'GitLab branch to test' | |
| required: false | |
| default: 'enterprise' | |
| concurrency: | |
| group: ${{ github.head_ref || github.run_id }}/plugin-workers | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| plugin-workers: | |
| name: "Plugin Worker: ${{ matrix.worker }}" | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - worker: erasure_coding | |
| path: test/plugin_workers/erasure_coding | |
| - worker: ec_repair | |
| path: test/plugin_workers/ec_repair | |
| - worker: vacuum | |
| path: test/plugin_workers/vacuum | |
| - worker: volume_balance | |
| path: test/plugin_workers/volume_balance | |
| steps: | |
| - name: Checkout artifactory repo | |
| uses: actions/checkout@v5 | |
| - name: Clone private GitLab repository | |
| env: | |
| GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} | |
| run: | | |
| if [ "${{ github.event_name }}" = "repository_dispatch" ]; then | |
| BRANCH_REF="${{ github.event.client_payload.ref }}" | |
| if [ "$BRANCH_REF" = "null" ] || [ -z "$BRANCH_REF" ]; then | |
| BRANCH="enterprise" | |
| else | |
| BRANCH=$(echo "$BRANCH_REF" | sed 's|refs/heads/||') | |
| fi | |
| else | |
| BRANCH="${{ github.event.inputs.gitlab_branch }}" | |
| if [ -z "$BRANCH" ]; then | |
| BRANCH="enterprise" | |
| fi | |
| fi | |
| echo "Cloning branch: $BRANCH" | |
| git clone -b $BRANCH https://gitlab-ci-token:${GITLAB_TOKEN}@gitlab.com/chrislusf/seaweedfs.git seaweedfs-source | |
| cd seaweedfs-source | |
| echo "Cloned commit: $(git rev-parse HEAD)" | |
| echo "COMMIT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV | |
| - name: Set up Go 1.x | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'seaweedfs-source/go.mod' | |
| cache-dependency-path: 'seaweedfs-source/go.sum' | |
| id: go | |
| - name: Run plugin worker tests | |
| working-directory: seaweedfs-source | |
| run: go test -v ./${{ matrix.path }} |