-
Notifications
You must be signed in to change notification settings - Fork 6
76 lines (64 loc) · 1.95 KB
/
ci.yml
File metadata and controls
76 lines (64 loc) · 1.95 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
name: Build and test
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
gravity:
name: Gravity tests
runs-on: ubuntu-latest
steps:
# Environment security
- name: Step Security
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
disable-sudo-and-containers: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
objects.githubusercontent.com:443
release-assets.githubusercontent.com:443
github.com:443
index.crates.io:443
static.crates.io:443
static.rust-lang.org:443
proxy.golang.org:443
# Checkout
# Most toolchains require checkout first
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Language toolchains
- name: Install Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version: stable
- name: Install Rust
uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
with:
# We start by installing the stable toolchain but the
# `rust-toolchain.toml` file takes precendence
toolchain: stable
- name: Inspect toolchain versions
run: |
cargo -V
go version
# Workflow
- name: cargo build
run: cargo build --locked --verbose
env:
CARGO_TERM_COLOR: always
- name: cargo test
run: cargo test --locked --verbose
env:
CARGO_TERM_COLOR: always
- name: go test
run: |
go generate ./...
go test ./...
- name: run snapshot tests
run: cargo test --locked --verbose --test cli