Skip to content

Commit

Permalink
Merge branch 'main' into fix/client
Browse files Browse the repository at this point in the history
# Conflicts:
#	client/.openapi-generator/FILES
#	client/.openapi-generator/VERSION
#	client/README.md
#	client/api/openapi.yaml
#	client/api_payments.go
#	client/client.go
#	client/docs/PaymentsApi.md
#	client/model_banking_circle_config.go
#	client/model_connector_base_info.go
#	client/model_currency_cloud_config.go
#	client/model_dummy_pay_config.go
#	client/model_list_connectors_response.go
#	client/model_list_payments_response.go
#	client/model_modulr_config.go
#	client/model_wise_config.go
#	client/test/api_payments_test.go
#	client/utils.go
#	main.go
#	swagger.yml
  • Loading branch information
darkmatterpool committed Dec 23, 2022
2 parents 951690c + bfef88a commit d359843
Show file tree
Hide file tree
Showing 170 changed files with 5,249 additions and 3,184 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/branch.yml

This file was deleted.

75 changes: 60 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,92 @@
on:
push:
branches:
- main
- 'main'
- 'features/**'
- 'feature/**'
- 'feat/**'
- 'fix/**'
- 'hotfix/**'
pull_request:
types: [ assigned, opened, synchronize, reopened ]
release:
types: [ prereleased, released ]

name: Main
jobs:
pr-style:
if: github.event_name == 'pull_request'
uses: numary/gh-workflows/.github/workflows/pr-style.yml@main

lint:
uses: formancehq/gh-workflows/.github/workflows/golang-lint.yml@main
uses: numary/gh-workflows/.github/workflows/golang-lint.yml@main

test:
uses: formancehq/gh-workflows/.github/workflows/golang-test.yml@main
uses: numary/gh-workflows/.github/workflows/golang-test.yml@main

goreleaser-build:
if: github.event_name != 'release'
uses: numary/gh-workflows/.github/workflows/goreleaser-build.yml@main
needs:
- lint
- test

build:
uses: formancehq/gh-workflows/.github/workflows/goreleaser-build.yml@main
goreleaser-release:
if: github.event_name == 'release'
uses: numary/gh-workflows/.github/workflows/goreleaser-release.yml@main
secrets:
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
needs:
- lint
- test

build-push:
name: 'Build & Push Docker image'
docker-build-push:
runs-on: ubuntu-latest
needs:
- lint
- test
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
- run: go mod vendor
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: "NumaryBot"
password: ${{ secrets.NUMARY_GITHUB_TOKEN }}
- name: Build and push
- if: github.event.action == 'released'
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/formancehq/payments:latest,ghcr.io/formancehq/payments:${{ github.event.release.tag_name }}
build-args: |
APP_SHA=${{ github.sha }}
VERSION=${{ github.event.release.tag_name }}
- if: github.event.action == 'prereleased'
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/formancehq/payments:${{ github.event.release.tag_name }}
build-args: |
APP_SHA=${{ github.sha }}
VERSION=${{ github.event.release.tag_name }}
- if: github.event.action != 'released' || github.event.action != 'prereleased'
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/formancehq/payments:main,ghcr.io/formancehq/payments:${{ github.sha }}
tags: ghcr.io/formancehq/payments:${{ github.sha }}
build-args: |
APP_SHA=${{ github.sha }}
VERSION=develop
33 changes: 0 additions & 33 deletions .github/workflows/pr-open.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/release.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ issues:
- goerr113
- varnamelen

- path: internal/app/migrations/
linters:
- gochecknoinits
- varnamelen

- linters:
- nolintlint
text: "should be written without leading space"
Expand Down
10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,17 @@ RUN apt-get update && \
ln -s /usr/bin/aarch64-linux-gnu-gcc /usr/bin/arm64-linux-gnu-gcc && \
ln -s /usr/bin/x86_64-linux-gnu-gcc /usr/bin/amd64-linux-gnu-gcc

# 1. Precompile the entire go standard library into the first Docker cache layer: useful for other projects too!
RUN CGO_ENABLED=0 GOOS=linux go install -v -installsuffix cgo -a std

ARG TARGETARCH
ARG APP_SHA
ARG VERSION

WORKDIR /go/src/github.com/formancehq/payments

# get deps first so it's cached
COPY go.mod .
COPY go.sum .

RUN go mod download

COPY . .

RUN go mod vendor

RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH \
CC=$TARGETARCH-linux-gnu-gcc \
go build -o bin/payments \
Expand Down
Loading

0 comments on commit d359843

Please sign in to comment.