Skip to content

Commit

Permalink
refactor: move all project to dedicated repo (#1726)
Browse files Browse the repository at this point in the history
  • Loading branch information
flemzord authored Sep 26, 2024
1 parent b37d1df commit 41a6d3a
Show file tree
Hide file tree
Showing 780 changed files with 142 additions and 77,761 deletions.
130 changes: 1 addition & 129 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,6 @@ jobs:
exit 1
fi
Tests:
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
env:
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
TestsIntegration:
runs-on: "formance-runner"
needs:
Expand All @@ -78,112 +58,4 @@ jobs:
${{ 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"
outputs:
components: ${{ steps.extract.outputs.components }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Extract service name
id: extract
run: echo "components=$(node .github/actions/find-directory/index.js)" >> $GITHUB_OUTPUT

GoReleaser:
runs-on: "ubuntu-latest"
if: contains(github.event.pull_request.labels.*.name, 'build-images') || github.ref == 'refs/heads/main' || github.event_name == 'merge_group'
needs:
- Extract
strategy:
matrix:
components: ${{ fromJson(needs.Extract.outputs.components) }}
steps:
- uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: "latest"
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
- name: Setup Env
uses: ./.github/actions/env
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: "NumaryBot"
password: ${{ secrets.NUMARY_GITHUB_TOKEN }}
- run: >
earthly
--no-output
--allow-privileged
--secret SPEAKEASY_API_KEY=$SPEAKEASY_API_KEY
--secret GITHUB_TOKEN=$GITHUB_TOKEN
--secret FURY_TOKEN=$FURY_TOKEN
--secret GORELEASER_KEY=$GORELEASER_KEY
${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }}
+goreleaser --path=${{ matrix.components }} --mode=ci
env:
GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
Deploy:
runs-on: "ubuntu-latest"
if: github.ref == 'refs/heads/main'
needs:
- GoReleaser
- Tests
- TestsIntegration
steps:
- uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: "latest"
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: "staging-regions: Sset Operator, Agent, Modules tags"
env:
# Only Region deployment need the token in order to deploy with argocd
ARGOCD_REGION_AUTH_TOKEN: ${{ secrets.ARGOCD_REGION_AUTH_TOKEN }}
# Only for module
STAGING_CLUSTER_KUBECONTEXT_NAME: ${{ secrets.STAGING_CLUSTER_KUBECONTEXT_NAME }}
STAGING_CLUSTER_NAME: ${{ secrets.STAGING_CLUSTER_NAME }}
STAGING_CLUSTER_REGION: ${{ secrets.STAGING_CLUSTER_REGION }}
TAG: ${{ github.sha }}
run: >
earthly
--no-output
--secret AUTH_TOKEN=$ARGOCD_REGION_AUTH_TOKEN
+staging-application-set
--TAG=$TAG
- name: "staging-regions: Sync"
env:
# Only Region deployment need the token in order to deploy with argocd
ARGOCD_REGION_AUTH_TOKEN: ${{ secrets.ARGOCD_REGION_AUTH_TOKEN }}
STAGING_CLUSTER_KUBECONTEXT_NAME: ${{ secrets.STAGING_CLUSTER_KUBECONTEXT_NAME }}
STAGING_CLUSTER_NAME: ${{ secrets.STAGING_CLUSTER_NAME }}
STAGING_CLUSTER_REGION: ${{ secrets.STAGING_CLUSTER_REGION }}
TAG: ${{ github.sha }}
run: >
earthly
--no-output
--secret AUTH_TOKEN=$ARGOCD_REGION_AUTH_TOKEN
+staging-application-sync
--TAG=$TAG
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
21 changes: 6 additions & 15 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ IMPORT github.com/formancehq/auth:main AS auth
IMPORT github.com/formancehq/search:main AS search
IMPORT github.com/formancehq/stargate:main AS stargate
IMPORT github.com/formancehq/webhooks:main AS webhooks

IMPORT github.com/formancehq/flows:main AS orchestration
IMPORT github.com/formancehq/reconciliation:main AS reconciliation
IMPORT github.com/formancehq/wallets:main AS wallets

sources:
FROM core+base-image
Expand All @@ -36,10 +38,9 @@ build-final-spec:
COPY (auth+openapi/openapi.yaml) /src/ee/auth/
COPY (search+openapi/openapi.yaml) /src/ee/search/
COPY (webhooks+openapi/openapi.yaml) /src/ee/webhooks/

FOR c IN wallets reconciliation orchestration
COPY (./ee/$c+openapi/openapi.yaml) /src/ee/$c/
END
COPY (wallets+openapi/openapi.yaml) /src/ee/wallets/
COPY (reconciliation+openapi/openapi.yaml) /src/ee/reconciliation/
COPY (orchestration+openapi/openapi.yaml) /src/ee/orchestration/

RUN npm run build
RUN jq -s '.[0] * .[1]' build/generate.json openapi-overlay.json > build/latest.json
Expand Down Expand Up @@ -146,28 +147,18 @@ staging-application-set:
staging-application-sync:
BUILD core+application-sync --APPLICATION=staging-eu-west-1-hosting-regions

tests:
LOCALLY
BUILD ./components+run --TARGET=tests
BUILD ./ee+run --TARGET=tests

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

pre-commit: # Generate the final spec and run all the pre-commit hooks
LOCALLY
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
BUILD ./components+run --TARGET=tidy
BUILD ./ee+run --TARGET=tidy
BUILD ./tests/integration+tidy

tests-all:
Expand Down
20 changes: 0 additions & 20 deletions components/Earthfile

This file was deleted.

3 changes: 0 additions & 3 deletions components/operator/.dockerignore

This file was deleted.

23 changes: 0 additions & 23 deletions components/operator/.earthly/configuration/.helmignore

This file was deleted.

6 changes: 0 additions & 6 deletions components/operator/.earthly/configuration/Chart.yaml

This file was deleted.

This file was deleted.

This file was deleted.

70 changes: 0 additions & 70 deletions components/operator/.earthly/configuration/templates/settings.yaml

This file was deleted.

Loading

0 comments on commit 41a6d3a

Please sign in to comment.