Skip to content

Commit

Permalink
trying this approach to depend on autofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelneale committed Mar 27, 2024
1 parent 2daa7c0 commit 64bc044
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 11 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/autofmt.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
on:
workflow_call:
pull_request:

name: Auto-format
concurrency:
concurrency:
group: ${{ github.ref }}-autofmt
cancel-in-progress: true
jobs:
Expand Down Expand Up @@ -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
25 changes: 22 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -126,4 +145,4 @@ jobs:
- console
- integration
- sql
uses: ./.github/workflows/autoversion.yml
uses: ./.github/workflows/autoversion.yml
19 changes: 14 additions & 5 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -20,26 +28,27 @@ 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
run: docker compose up -d --wait
- 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
9 changes: 8 additions & 1 deletion .github/workflows/rebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,4 +31,4 @@ jobs:
- name: Init DB
run: just init-db
- name: Rebuild All
run: just build-all
run: just build-all

0 comments on commit 64bc044

Please sign in to comment.