-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (56 loc) · 1.82 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
# This workflow will be triggered by a GitHub pull-request.
# It compiles the code to a release binary, create a Docker image containing
# the binary, and uploads the Docker image to our registry using the branch as
# the registry tag.
---
name: Build development image
on:
pull_request:
branches: ["*"]
env:
CARGO_TERM_COLOR: always
DISABLE_VERSION_CHECK: true
jobs:
build:
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v3
- uses: de-vri-es/setup-git-credentials@v2
with:
credentials: "https://fiberplanebot:${{ secrets.PRIVATE_GITHUB_TOKEN }}@github.com/"
- uses: Swatinem/rust-cache@v2
- name: add rust components
run: |
rustup component add clippy
rustup component add rustfmt
- name: Check format
run: cargo fmt -- --check
- name: Build binary and tests
run: cargo build --bins --tests --release
- name: Clippy
uses: giraffate/clippy-action@v1
with:
filter_mode: nofilter
fail_on_error: true
clippy_flags: --all-features --release
- name: Run tests
run: cargo test --release --all
# Clap has specific debug asserts when generating completions
- name: Run Completion generation test
run: cargo test generating_completions --bin fp
- name: Generate manifest
run: target/release/fp version -o json > manifest.json
- name: Upload fp
uses: actions/upload-artifact@v3
with:
name: fp
path: target/release/fp
if-no-files-found: error
retention-days: 1
- name: Upload manifest
uses: actions/upload-artifact@v3
with:
name: manifest.json
path: manifest.json
if-no-files-found: error
retention-days: 1