This repository has been 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
91 lines (84 loc) · 2.22 KB
/
build.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
name: Build
# Controls when the action will run.
on:
push:
branches: [main, dev]
pull_request:
types: [opened, synchronize]
workflow_dispatch:
# Set an environment variable (that can be overriden) for the Docker Repo
env:
DOCKER_REPO: freeverseio/laos-ownership-node
jobs:
check:
if: github.event_name == 'pull_request'
runs-on:
group: laos
labels: ubuntu-16-cores
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- uses: ./.github/actions/cache
with:
cache-key: build_and_push
- name: Check
run: |
SKIP_WASM_BUILD=1 cargo check --release
build_and_push:
if: github.event_name == 'push'
runs-on:
group: laos
labels: ubuntu-16-cores
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- uses: ./.github/actions/cache
with:
cache-key: build_and_push
- name: Build
run: |
cargo build --release
- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- 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:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- uses: ./.github/actions/cache
with:
cache-key: lint
- name: check format
run: |
cargo fmt --all --check
- name: install clippy
run: |
rustup component add clippy
- 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:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- uses: ./.github/actions/cache
with:
cache-key: test
- name: Test
run: |
SKIP_WASM_BUILD=1 cargo test