This repository was archived by the owner on Oct 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (108 loc) · 3.53 KB
/
Copy pathbuild.yml
File metadata and controls
130 lines (108 loc) · 3.53 KB
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
122
123
124
125
126
127
name: Build
# Controls when the action will run.
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
workflow_dispatch:
# Set an environment variable (that can be overriden) for the Docker Repo
env:
DOCKER_REPO: freeverseio/laos-ownership-node
jobs:
build_and_push:
runs-on:
group: laos
labels: ubuntu-16-cores
steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v3
- name: Install linux dependencies
run: sudo apt-get install -y clang libssl-dev llvm libudev-dev protobuf-compiler
- name: Install Rust
run: |
rustup update stable --no-self-update
rustup target add wasm32-unknown-unknown
# Caching paths to speed up builds
- name: Cache Paths
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: |
cargo build --release
# Login to Docker hub using the credentials stored in the repository secrets
- name: Log in to Docker Hub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
# create Docker image and push to Docker Hub
- name: Push Docker images
uses: docker/build-push-action@v4
with:
context: .
file: ./local.Dockerfile
push: true
tags: ${{ env.DOCKER_REPO }}:${{ github.sha }}
lint:
runs-on:
group: laos
labels: ubuntu-16-cores
steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v3
- name: Install linux dependencies
run: sudo apt-get install -y clang libssl-dev llvm libudev-dev protobuf-compiler
- name: Install Rust
run: |
rustup update stable --no-self-update
rustup target add wasm32-unknown-unknown
rustup component add clippy
# Caching paths to speed up builds
- name: Cache Paths
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
- name: Check clippy
run: |
cargo clippy --all-targets --workspace --features runtime-benchmarks --features try-runtime
test:
runs-on:
group: laos
labels: ubuntu-16-cores
steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v3
- name: Install linux dependencies
run: sudo apt-get install -y clang libssl-dev llvm libudev-dev protobuf-compiler
- name: Install Rust
run: |
rustup update stable --no-self-update
rustup target add wasm32-unknown-unknown
# Caching paths to speed up builds
- name: Cache Paths
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
- name: Test
run: |
cargo test