Skip to content

Commit

Permalink
Merge branch 'main' into releases/v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed May 21, 2024
2 parents b4a1f03 + 21aebfb commit 3316b72
Show file tree
Hide file tree
Showing 287 changed files with 9,987 additions and 4,769 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = 4
27 changes: 24 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: ./.github/actions/env
- run: >
earthly
--allow-privileged
--allow-privileged --auto-skip
--secret SPEAKEASY_API_KEY=$SPEAKEASY_API_KEY
${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }}
+pre-commit
Expand All @@ -40,7 +40,7 @@ jobs:
exit 1
fi
Main:
Tests:
runs-on: "formance-runner"
needs:
- Dirty
Expand All @@ -60,6 +60,26 @@ jobs:
env:
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
TestsIntegration:
runs-on: "formance-runner"
needs:
- Dirty
steps:
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
- name: Setup Env
uses: ./.github/actions/env
- run: >
earthly
--no-output
--allow-privileged
--secret SPEAKEASY_API_KEY=$SPEAKEASY_API_KEY
${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }}
+tests-integration
env:
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
Extract:
name: Extract
runs-on: "ubuntu-latest"
Expand Down Expand Up @@ -121,7 +141,8 @@ jobs:
if: github.ref == 'refs/heads/main'
needs:
- GoReleaser
- Main
- Tests
- TestsIntegration
steps:
- uses: earthly/actions-setup@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: ./.github/actions/env
- run: >
earthly
--allow-privileged
--allow-privileged --auto-skip
--secret SPEAKEASY_API_KEY=$SPEAKEASY_API_KEY
${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }}
+pre-commit
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
Sdks:
OpenAPI:
runs-on: "ubuntu-latest"
needs:
- GoReleaser
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
- name: Publish Helm
run: >
earthly
--allow-privileged
--allow-privileged --auto-skip
--secret GITHUB_TOKEN=$GITHUB_TOKEN
+helm-publish
env:
Expand Down
56 changes: 21 additions & 35 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION 0.8
PROJECT FormanceHQ/stack

ARG core=github.com/formancehq/earthly
IMPORT $core AS core
IMPORT github.com/formancehq/earthly:tags/v0.12.0 AS core

sources:
FROM core+base-image
Expand All @@ -12,7 +12,7 @@ sources:
speakeasy:
FROM core+base-image
RUN apk update && apk add yarn jq unzip curl
ARG VERSION=v1.147.0
ARG VERSION=v1.292.0
ARG TARGETARCH
RUN curl -fsSL https://github.com/speakeasy-api/speakeasy/releases/download/${VERSION}/speakeasy_linux_$TARGETARCH.zip -o /tmp/speakeasy_linux_$TARGETARCH.zip
RUN unzip /tmp/speakeasy_linux_$TARGETARCH.zip speakeasy
Expand Down Expand Up @@ -157,53 +157,39 @@ staging-application-set:
staging-application-sync:
BUILD core+application-sync --APPLICATION=staging-eu-west-1-hosting-regions

tests-all:
tests:
LOCALLY
FOR component IN $(cd ./components && ls -d */)
BUILD --pass-args ./components/${component}+tests
END
FOR component IN $(cd ./ee && ls -d */)
BUILD --pass-args ./ee/${component}+tests
END
BUILD ./components+run --TARGET=tests
BUILD ./ee+run --TARGET=tests

tests-integration:
FROM core+base-image
BUILD --pass-args ./tests/integration+tests
BUILD ./tests/integration+tests

pre-commit: # Generate the final spec and run all the pre-commit hooks
LOCALLY
BUILD --pass-args ./releases+sdk-generate
FOR component IN $(cd ./libs && ls -d */)
BUILD --pass-args ./libs/${component}+pre-commit
END
FOR component IN $(cd ./components && ls -d */)
BUILD --pass-args ./components/${component}+pre-commit
END
FOR component IN $(cd ./ee && ls -d */)
BUILD --pass-args ./ee/${component}+pre-commit
END
BUILD --pass-args ./helm/+pre-commit
BUILD --pass-args ./tests/integration+pre-commit
BUILD ./releases+sdk-generate
BUILD ./libs+run --TARGET=pre-commit
BUILD ./components+run --TARGET=pre-commit
BUILD ./ee+run --TARGET=pre-commit
BUILD ./helm/+pre-commit
BUILD ./tests/integration+pre-commit

tidy: # Run tidy on all the components
LOCALLY
FOR component IN $(cd ./components && ls -d */)
BUILD --pass-args ./components/${component}+tidy
END
FOR component IN $(cd ./ee && ls -d */)
BUILD --pass-args ./ee/${component}+tidy
END
BUILD --pass-args ./tests/integration+tidy
BUILD ./components+run --TARGET=tidy
BUILD ./ee+run --TARGET=tidy
BUILD ./tests/integration+tidy

tests:
tests-all:
LOCALLY
BUILD --pass-args +tests-all
BUILD --pass-args +tests-integration
BUILD +tests
BUILD +tests-integration

helm-publish:
LOCALLY
BUILD --pass-args ./helm/+publish
BUILD --pass-args ./components/operator+helm-publish
BUILD ./helm/+publish
BUILD ./components/operator+helm-publish

HELM_PUBLISH:
FUNCTION
Expand Down
13 changes: 9 additions & 4 deletions components/Earthfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
VERSION 0.8

ARG core=github.com/formancehq/earthly

IMPORT $core AS core
IMPORT github.com/formancehq/earthly:tags/v0.12.0 AS core
IMPORT .. AS stack

deploy:
Expand All @@ -13,4 +11,11 @@ deploy:
deploy-staging:
FROM core+base-image
ARG --required components
BUILD --pass-args ./$components+deploy-staging
BUILD --pass-args ./$components+deploy-staging

run:
LOCALLY
ARG --required TARGET
BUILD ./ledger+$TARGET
BUILD ./operator+$TARGET
BUILD ./payments+$TARGET
2 changes: 1 addition & 1 deletion components/fctl/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ builds:
id: fctl
ldflags:
- -X github.com/formancehq/fctl/cmd/version.BuildDate={{ .Date }}
- -X github.com/formancehq/fctl/cmd/version.Version={{ .Version }}
- -X github.com/formancehq/fctl/cmd/version.Version=v{{ .Version }}
- -X github.com/formancehq/fctl/cmd/version.Commit={{ .ShortCommit }}
- -extldflags "-static"
env:
Expand Down
4 changes: 1 addition & 3 deletions components/fctl/Earthfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
VERSION 0.8

ARG core=github.com/formancehq/earthly

IMPORT $core AS core
IMPORT github.com/formancehq/earthly:tags/v0.12.0 AS core
IMPORT ../.. AS stack
IMPORT ../../releases AS releases
IMPORT .. AS components
Expand Down
2 changes: 1 addition & 1 deletion components/ledger/.goreleaser.ledger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ builds:
id: ledger
ldflags:
- -X github.com/formancehq/ledger/cmd.BuildDate={{ .Date }}
- -X github.com/formancehq/ledger/cmd.Version={{ .Version }}
- -X github.com/formancehq/ledger/cmd.Version=v{{ .Version }}
- -X github.com/formancehq/ledger/cmd.Commit={{ .ShortCommit }}
- -extldflags "-static"
env:
Expand Down
2 changes: 1 addition & 1 deletion components/ledger/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ builds:
id: ledger
ldflags:
- -X github.com/formancehq/ledger/cmd.BuildDate={{ .Date }}
- -X github.com/formancehq/ledger/cmd.Version={{ .Version }}
- -X github.com/formancehq/ledger/cmd.Version=v{{ .Version }}
- -X github.com/formancehq/ledger/cmd.Commit={{ .ShortCommit }}
- -extldflags "-static"
env:
Expand Down
4 changes: 1 addition & 3 deletions components/ledger/Earthfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
VERSION 0.8

ARG core=github.com/formancehq/earthly

IMPORT $core AS core
IMPORT github.com/formancehq/earthly:tags/v0.12.0 AS core
IMPORT ../.. AS stack
IMPORT .. AS components

Expand Down
2 changes: 1 addition & 1 deletion components/operator/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ builds:
main: ./cmd
ldflags:
- -X github.com/formancehq/operator/cmd.BuildDate={{ .Date }}
- -X github.com/formancehq/operator/cmd.Version={{ .Version }}
- -X github.com/formancehq/operator/cmd.Version=v{{ .Version }}
- -X github.com/formancehq/operator/cmd.Commit={{ .ShortCommit }}
- -extldflags "-static"
env:
Expand Down
3 changes: 1 addition & 2 deletions components/operator/Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
VERSION 0.8

ARG core=github.com/formancehq/earthly
IMPORT $core AS core
IMPORT github.com/formancehq/earthly:tags/v0.12.0 AS core
IMPORT ../.. AS stack
IMPORT .. AS components

Expand Down
2 changes: 1 addition & 1 deletion components/operator/tools/utils/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ builds:
id: operator-utils
ldflags:
- -X github.com/formancehq/operator-utils/cmd.BuildDate={{ .Date }}
- -X github.com/formancehq/operator-utils/cmd.Version={{ .Version }}
- -X github.com/formancehq/operator-utils/cmd.Version=v{{ .Version }}
- -X github.com/formancehq/operator-utils/cmd.Commit={{ .ShortCommit }}
- -extldflags "-static"
env:
Expand Down
3 changes: 1 addition & 2 deletions components/operator/tools/utils/Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
VERSION 0.8

ARG core=github.com/formancehq/earthly
IMPORT $core AS core
IMPORT github.com/formancehq/earthly:tags/v0.12.0 AS core
IMPORT ../../../.. AS stack
IMPORT ../../.. AS components

Expand Down
2 changes: 1 addition & 1 deletion components/payments/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ builds:
id: payments
ldflags:
- -X github.com/formancehq/payments/cmd.BuildDate={{ .Date }}
- -X github.com/formancehq/payments/cmd.Version={{ .Version }}
- -X github.com/formancehq/payments/cmd.Version=v{{ .Version }}
- -X github.com/formancehq/payments/cmd.Commit={{ .ShortCommit }}
- -extldflags "-static"
env:
Expand Down
4 changes: 1 addition & 3 deletions components/payments/Earthfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
VERSION 0.8

ARG core=github.com/formancehq/earthly

IMPORT $core AS core
IMPORT github.com/formancehq/earthly:tags/v0.12.0 AS core
IMPORT ../.. AS stack
IMPORT ../../releases AS releases
IMPORT .. AS components
Expand Down
19 changes: 15 additions & 4 deletions ee/Earthfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
VERSION 0.8

ARG core=github.com/formancehq/earthly

IMPORT $core AS core
IMPORT github.com/formancehq/earthly:tags/v0.12.0 AS core
IMPORT .. AS stack

deploy:
Expand All @@ -13,4 +11,17 @@ deploy:
deploy-staging:
FROM core+base-image
ARG --required components
BUILD --pass-args ./$components+deploy-staging
BUILD --pass-args ./$components+deploy-staging

run:
LOCALLY
ARG --required TARGET
BUILD ./agent+$TARGET
BUILD ./auth+$TARGET
BUILD ./gateway+$TARGET
BUILD ./orchestration+$TARGET
BUILD ./reconciliation+$TARGET
BUILD ./search+$TARGET
BUILD ./stargate+$TARGET
BUILD ./wallets+$TARGET
BUILD ./webhooks+$TARGET
2 changes: 1 addition & 1 deletion ee/agent/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ builds:
id: agent
ldflags:
- -X github.com/formancehq/stack/components/agent/cmd.BuildDate={{ .Date }}
- -X github.com/formancehq/stack/components/agent/cmd.Version={{ .Version }}
- -X github.com/formancehq/stack/components/agent/cmd.Version=v{{ .Version }}
- -X github.com/formancehq/stack/components/agent/cmd.Commit={{ .ShortCommit }}
- -extldflags "-static"
env:
Expand Down
3 changes: 1 addition & 2 deletions ee/agent/Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
VERSION 0.8

ARG core=github.com/formancehq/earthly
IMPORT $core AS core
IMPORT github.com/formancehq/earthly:tags/v0.12.0 AS core

IMPORT ../.. AS stack
IMPORT .. AS ee
Expand Down
2 changes: 1 addition & 1 deletion ee/auth/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ builds:
id: auth
ldflags:
- -X github.com/formancehq/auth/cmd.BuildDate={{ .Date }}
- -X github.com/formancehq/auth/cmd.Version={{ .Version }}
- -X github.com/formancehq/auth/cmd.Version=v{{ .Version }}
- -X github.com/formancehq/auth/cmd.Commit={{ .ShortCommit }}
- -extldflags "-static"
env:
Expand Down
4 changes: 1 addition & 3 deletions ee/auth/Earthfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
VERSION 0.8

ARG core=github.com/formancehq/earthly

IMPORT $core AS core
IMPORT github.com/formancehq/earthly:tags/v0.12.0 AS core
IMPORT ../.. AS stack
IMPORT .. AS ee

Expand Down
2 changes: 1 addition & 1 deletion ee/gateway/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ builds:
id: gateway
ldflags:
- -X github.com/formancehq/stack/components/gateway/cmd.BuildDate={{ .Date }}
- -X github.com/formancehq/stack/components/gateway/cmd.Version={{ .Version }}
- -X github.com/formancehq/stack/components/gateway/cmd.Version=v{{ .Version }}
- -X github.com/formancehq/stack/components/gateway/cmd.Commit={{ .ShortCommit }}
- -extldflags "-static"
env:
Expand Down
4 changes: 1 addition & 3 deletions ee/gateway/Earthfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
VERSION 0.8

ARG core=github.com/formancehq/earthly

IMPORT $core AS core
IMPORT github.com/formancehq/earthly:tags/v0.12.0 AS core
IMPORT ../.. AS stack
IMPORT .. AS ee

Expand Down
Loading

0 comments on commit 3316b72

Please sign in to comment.