-
Notifications
You must be signed in to change notification settings - Fork 10
120 lines (101 loc) · 3.5 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: CI
on:
pull_request:
branches: [main]
concurrency:
group: ci/${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Rust cache
uses: swatinem/rust-cache@v2
- name: Clone Dozer
run: |
git clone http://github.com/getdozer/dozer.git
- name: Restore Dozer cache
uses: actions/cache@v3
with:
path: |
dozer/
key: ${{ runner.os }}-dozer-${{ hashFiles('**/dozer/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-dozer-
- name: Build Dozer binary
run: |
cd dozer
cargo build --features ethereum,snowflake,kafka --bin dozer
mkdir -p $GITHUB_WORKSPACE/dozer-bin
cp target/debug/dozer $GITHUB_WORKSPACE/dozer-bin/dozer
- name: Archive Dozer binary
uses: actions/upload-artifact@v2
with:
name: dozer-bin-artifact
path: dozer-bin/dozer
test:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download Dozer binary artifact
uses: actions/download-artifact@v2
with:
name: dozer-bin-artifact
path: dozer-bin
- name: Install Protoc, Snowflake ODBC Driver
run: |
curl -sLO https://github.com/protocolbuffers/protobuf/releases/download/v22.2/protoc-22.2-linux-x86_64.zip
unzip protoc-22.2-linux-x86_64.zip -d $HOME/.local
export PATH="$PATH:$HOME/.local/bin"
curl ${SNOWFLAKE_DRIVER_URL} -o snowflake_driver.deb && sudo dpkg -i snowflake_driver.deb
env:
SNOWFLAKE_DRIVER_URL: https://sfc-repo.snowflakecomputing.com/odbc/linux/2.25.7/snowflake-odbc-2.25.7.x86_64.deb
- name: Setup Dozer binary
run: |
mkdir -p $HOME/.cargo/bin
cp dozer-bin/dozer $HOME/.cargo/bin/
chmod +x $HOME/.cargo/bin/dozer
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Restore pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Run tests
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_REGION_S3: ${{ secrets.AWS_REGION_S3 }}
AWS_BUCKET_NAME: ${{ secrets.AWS_BUCKET_NAME }}
SN_SERVER: ${{ secrets.SN_SERVER }}
SN_USER: ${{ secrets.SN_USER }}
SN_PASSWORD: ${{ secrets.SN_PASSWORD }}
SN_DATABASE: ${{ secrets.SN_DATABASE }}
SN_WAREHOUSE: ${{ secrets.SN_WAREHOUSE }}
SN_ROLE: ${{ secrets.SN_ROLE }}
ETH_WSS_URL: ${{ secrets.ETH_WSS_URL }}
PG_HOST: ${{ secrets.PG_HOST }}
PG_USER: ${{ secrets.PG_USER }}
PG_PASSWORD: ${{ secrets.PG_PASSWORD }}
PG_DB: ${{ secrets.PG_DB }}
run: pnpm test