move common workflow steps into composite action #90
Workflow file for this run
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: Test | |
| on: | |
| push: | |
| branches-ignore: | |
| - 'development/**' | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| lint: | |
| name: Lint and typecheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup and Build | |
| uses: ./.github/actions/setup-and-build | |
| - name: TypeScript typecheck | |
| run: yarn typecheck | |
| - name: Lint | |
| run: yarn lint | |
| test-mongodb-backend: | |
| name: Test with MongoDB backend | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - name: Setup and Build | |
| uses: ./.github/actions/setup-and-build | |
| - name: Start Cloudserver with MongoDB backend | |
| run: docker compose -f .github/docker-compose.cloudserver-mongo.yml up -d | |
| - name: Wait for Cloudserver to be ready | |
| run: | | |
| set -o pipefail | |
| bash .github/scripts/wait_for_local_port.bash 8000 40 | |
| - name: Run MongoDB backend tests | |
| run: yarn test:mongo-backend | |
| - name: Stop Cloudserver | |
| if: always() | |
| run: docker compose -f .github/docker-compose.cloudserver-mongo.yml down | |
| test-metadata-backend: | |
| name: Test with Scality metadata backend | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - name: Setup and Build | |
| uses: ./.github/actions/setup-and-build | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ github.token }} | |
| - name: Start Cloudserver with Scality metadata backend | |
| run: docker compose -f .github/docker-compose.cloudserver-metadata.yml up -d | |
| - name: Wait for metadata to be ready | |
| run: | | |
| set -o pipefail | |
| bash .github/scripts/wait_for_local_port.bash 9000 40 | |
| - name: Wait for Cloudserver to be ready | |
| run: | | |
| set -o pipefail | |
| bash .github/scripts/wait_for_local_port.bash 8000 60 | |
| - name: Run metadata backend tests | |
| run: yarn test:metadata-backend | |
| - name: Stop Cloudserver | |
| if: always() | |
| run: docker compose -f .github/docker-compose.cloudserver-metadata.yml down |