Skip to content

Commit 10547d1

Browse files
authoredJan 12, 2023
Merge pull request #1 from gobicycle/develop
Pre-release
2 parents 07fced6 + 907d9ef commit 10547d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+16248
-3
lines changed
 

‎.github/workflows/go.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
environment: TESTS
13+
services:
14+
postgres:
15+
image: postgres
16+
env:
17+
POSTGRES_DB: payment_processor
18+
POSTGRES_USER: pp_user
19+
POSTGRES_PASSWORD: postgres
20+
options: >-
21+
--health-cmd pg_isready
22+
--health-interval 10s
23+
--health-timeout 5s
24+
--health-retries 5
25+
ports:
26+
- 5432:5432
27+
steps:
28+
- uses: actions/checkout@v3
29+
with:
30+
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
31+
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
32+
33+
- name: Set up Go
34+
uses: actions/setup-go@v3
35+
with:
36+
go-version: 1.19
37+
38+
- name: Build
39+
run: go build -v ./...
40+
41+
- uses: actions/cache@v2
42+
with:
43+
path: ~/go/pkg/mod
44+
key: ${{ runner.os }}-2go-${{ hashFiles('**/go.sum') }}
45+
restore-keys: |
46+
${{ runner.os }}-2go-
47+
48+
- name: Install dependencies
49+
run: |
50+
sudo apt-get update
51+
sudo apt-get -y install git zlib1g-dev libssl-dev
52+
53+
- name: Install libs
54+
run: |
55+
git clone https://github.com/startfellows/tongo /tmp/tongo
56+
sudo cp /tmp/tongo/lib/linux/libemulator.so /lib
57+
58+
- name: Run Test
59+
env:
60+
SEED: ${{ secrets.SEED }}
61+
SERVER: ${{ secrets.SERVER }}
62+
KEY: ${{ secrets.KEY }}
63+
DB_URI: postgresql://pp_user:postgres@localhost:5432/payment_processor?sslmode=disable
64+
run: |
65+
go test -v $(go list ./...)

‎Dockerfile

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
FROM ubuntu:20.04 AS emulator-builder
2+
ENV DEBIAN_FRONTEND=noninteractive
3+
RUN apt-get update
4+
RUN apt-get -y install git cmake g++ zlib1g-dev libssl-dev
5+
RUN git clone --recurse-submodules -b emulator_vm_verbosity https://github.com/dungeon-master-666/ton.git
6+
RUN mkdir build && (cd build && cmake ../ton -DCMAKE_BUILD_TYPE=Release && cmake --build . --target emulator)
7+
RUN mkdir /output && cp build/emulator/libemulator.so /output
8+
9+
FROM golang:1.19.2 AS builder
10+
WORKDIR /build-dir
11+
COPY go.mod .
12+
COPY go.sum .
13+
RUN go mod download all
14+
COPY api api
15+
COPY blockchain blockchain
16+
COPY cmd cmd
17+
COPY config config
18+
COPY core core
19+
COPY db db
20+
COPY audit audit
21+
COPY queue queue
22+
RUN go build -o /tmp/processor github.com/gobicycle/bicycle/cmd/processor
23+
RUN go build -o /tmp/testutil github.com/gobicycle/bicycle/cmd/testutil
24+
25+
FROM ubuntu:20.04 AS payment-processor
26+
RUN apt-get update
27+
RUN apt-get -y install zlib1g-dev libssl-dev
28+
RUN mkdir -p /lib
29+
COPY --from=builder /tmp/processor /app/processor
30+
COPY --from=emulator-builder /output/libemulator.so /lib
31+
ENV LD_LIBRARY_PATH=/lib
32+
CMD ["/app/processor", "-v"]
33+
34+
FROM ubuntu:20.04 AS payment-test
35+
RUN apt-get update
36+
RUN apt-get -y install zlib1g-dev libssl-dev
37+
RUN mkdir -p /lib
38+
COPY --from=builder /tmp/testutil /app/testutil
39+
COPY --from=emulator-builder /output/libemulator.so /lib
40+
ENV LD_LIBRARY_PATH=/lib
41+
CMD ["/app/testutil", "-v"]

0 commit comments

Comments
 (0)
Please sign in to comment.