-
Notifications
You must be signed in to change notification settings - Fork 39
121 lines (105 loc) · 3.86 KB
/
test.yml
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
121
name: Build das api components
# This workflow uses github runners.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# This may be adjusted to whatever suits best your runners config.
# Current config will build on manual trigger or pull-request (each push)
on:
# pull_request can be removed, to save minutes on github runners
pull_request:
workflow_dispatch:
push:
branches:
- 'main'
env:
CARGO_TERM_COLOR: always
jobs:
build-api:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
# This can be also be runned on self-hosted github runners
runs-on: ["${{ matrix.os }}"]
steps:
- name: checkout repo
uses: actions/checkout@v3
# This step can be omited, to save storage space on the organization account
# Build process will take longer
- name: set build cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
digital-asset-rpc-infrastructure/target/
key: ${{ matrix.os }}_digital-asset-rpc-infrastructure_${{ hashFiles('digital-asset-rpc-infrastructure/Cargo.lock') }}
restore-keys: |
${{ matrix.os }}_digital-asset-rpc-infrastructure
- name: build digital asset rpc infra
run: cargo build --verbose --release
- name: build das_api
working-directory: das_api
run: cargo build --verbose --release
- name: build migration
working-directory: migration
run: cargo build --verbose --release
- name: rename binaries for ubuntu22 release
if: matrix.os == 'ubuntu-22.04'
run: |
mv target/release/nft_ingester target/release/nft_ingester22
mv target/release/fetch_trees target/release/fetch_trees22
mv das_api/target/release/das_api das_api/target/release/das_api22
mv migration/target/release/migration migration/target/release/migration22
# This steps can be omited to save space, are mostly in place to validate binaries (manually) and path to them
# Omiting this will save on storage consumption on the account
- name: Publish artifact
if: matrix.os == 'ubuntu-22.04'
uses: actions/[email protected]
with:
name: nft_ingester22
path: target/release/nft_ingester22
- name: Publish artifact
if: matrix.os == 'ubuntu-22.04'
uses: actions/[email protected]
with:
name: das_api22
path: das_api/target/release/das_api22
- name: Publish artifact
if: matrix.os == 'ubuntu-22.04'
uses: actions/[email protected]
with:
name: migration22
path: migration/target/release/migration22
- name: Publish artifact
if: matrix.os == 'ubuntu-22.04'
uses: actions/[email protected]
with:
name: fetch-trees22
path: migration/target/release/fetch_trees22
- name: Publish artifact
if: matrix.os == 'ubuntu-20.04'
uses: actions/[email protected]
with:
name: nft_ingester
path: target/release/nft_ingester
- name: Publish artifact
if: matrix.os == 'ubuntu-20.04'
uses: actions/[email protected]
with:
name: das_api
path: das_api/target/release/das_api
- name: Publish artifact
if: matrix.os == 'ubuntu-20.04'
uses: actions/[email protected]
with:
name: migration
path: migration/target/release/migration
- name: Publish artifact
if: matrix.os == 'ubuntu-20.04'
uses: actions/[email protected]
with:
name: fetch-trees
path: target/release/fetch_trees