diff --git a/.github/workflows/autofmt.yml b/.github/workflows/autofmt.yml index 6c928e0c9e..461b94e486 100644 --- a/.github/workflows/autofmt.yml +++ b/.github/workflows/autofmt.yml @@ -1,7 +1,9 @@ on: + workflow_call: pull_request: + name: Auto-format -concurrency: +concurrency: group: ${{ github.ref }}-autofmt cancel-in-progress: true jobs: @@ -32,4 +34,4 @@ jobs: git config --global user.name "github-actions[bot]" git remote set-url origin https://x-access-token:${{ secrets.FTL_AUTOFMT_TOKEN }}@github.com/${{ github.repository }} git commit -am "chore(autofmt): Automated formatting" - git push + git push \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91e9610ee3..ac62410b20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,13 +3,20 @@ on: branches: - main pull_request: + name: CI concurrency: group: ${{ github.ref }}-ci cancel-in-progress: true + jobs: + autofmt: + name: Auto Format + uses: ./.github/workflows/autofmt.yml + kotlin-runtime: name: Test Kotlin + needs: autofmt runs-on: ubuntu-latest steps: - name: Checkout code @@ -20,8 +27,10 @@ jobs: uses: ./.github/actions/build-cache - name: Test run: mvn -f kotlin-runtime/ftl-runtime -B test + test: name: Test Go + needs: autofmt runs-on: ubuntu-latest steps: - name: Checkout code @@ -33,11 +42,13 @@ jobs: - name: Build Kotlin run: just build-kt-runtime - name: Docker Compose - run: docker compose up -d --wait + run: docker compose up -d --wait - name: Test run: go-test-annotate + sql: name: SQL + needs: autofmt runs-on: ubuntu-latest steps: - name: Checkout code @@ -52,8 +63,10 @@ jobs: run: just init-db - name: Vet SQL run: sqlc vet + lint: name: Lint + needs: autofmt runs-on: ubuntu-latest steps: - name: Checkout code @@ -76,8 +89,10 @@ jobs: - name: shellcheck shell: bash run: shellcheck -f gcc -e SC2016 scripts/* | to-annotation + proto-breaking: - name: Proto Breaking Change Check + name: Proto Breaking Change Check + needs: autofmt runs-on: ubuntu-latest steps: - name: Checkout code @@ -89,8 +104,10 @@ jobs: - name: Proto Breaking Change Check shell: bash run: buf breaking --against 'https://github.com/TBD54566975/ftl.git#branch=main' | to-annotation + console: name: Console + needs: autofmt runs-on: ubuntu-latest steps: - name: Checkout code @@ -111,10 +128,12 @@ jobs: - name: Console Test working-directory: frontend run: npm run test + integration: name: Integration Tests if: github.ref == 'refs/heads/main' uses: ./.github/workflows/integration.yml + autoversion: name: Auto Version secrets: inherit @@ -126,4 +145,4 @@ jobs: - console - integration - sql - uses: ./.github/workflows/autoversion.yml + uses: ./.github/workflows/autoversion.yml \ No newline at end of file diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 425ea0d824..c1ffb30a0a 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,13 +1,21 @@ on: workflow_call: workflow_dispatch: + concurrency: group: ${{ github.ref }}-integration cancel-in-progress: true + name: Integration + jobs: + autofmt: + name: Auto Format + uses: ./.github/workflows/autofmt.yml + prepare: - runs-on: ubuntu-latest + needs: autofmt + runs-on: ubuntu-latest outputs: matrix: ${{ steps.extract-tests.outputs.matrix }} steps: @@ -20,19 +28,20 @@ jobs: run: | # shellcheck disable=SC2046 echo "matrix={\"test\":$(jq -c -n '$ARGS.positional' --args $(grep '^func Test' integration/*_test.go | awk '{print $2}' | cut -d'(' -f1))}" >> "$GITHUB_OUTPUT" + integration: needs: prepare runs-on: ubuntu-latest strategy: fail-fast: false - matrix: ${{fromJson(needs.prepare.outputs.matrix)}} + matrix: ${{fromJson(needs.prepare.outputs.matrix)}} steps: - name: Checkout code uses: actions/checkout@v4 - name: Init Hermit uses: cashapp/activate-hermit@v1 with: - cache: true + cache: true - name: Build Cache uses: ./.github/actions/build-cache - name: Docker Compose @@ -40,6 +49,6 @@ jobs: - name: Create DB run: just init-db - name: Download Go Modules - run: go mod download + run: go mod download - name: Run ${{ matrix.test }} - run: go test -v -tags integration -run ${{ matrix.test }} ./integration + run: go test -v -tags integration -run ${{ matrix.test }} ./integration \ No newline at end of file diff --git a/.github/workflows/rebuild.yml b/.github/workflows/rebuild.yml index a300bcb232..9616e1202e 100644 --- a/.github/workflows/rebuild.yml +++ b/.github/workflows/rebuild.yml @@ -3,13 +3,20 @@ on: branches: - main pull_request: + name: Rebuild All concurrency: group: ${{ github.ref }}-rebuild-all cancel-in-progress: true + jobs: + autofmt: + name: Auto Format + uses: ./.github/workflows/autofmt.yml + build-all: name: Rebuild All + needs: autofmt runs-on: ubuntu-latest steps: - name: Checkout code @@ -24,4 +31,4 @@ jobs: - name: Init DB run: just init-db - name: Rebuild All - run: just build-all + run: just build-all \ No newline at end of file