-
Notifications
You must be signed in to change notification settings - Fork 4
144 lines (135 loc) · 3.93 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Test
on:
pull_request:
push:
branches:
- master
env:
REQWEST_TEST_BODY_FULL: 1
RUST_BACKTRACE: 1
jobs:
style:
name: Check Style
runs-on: ubuntu-latest
env:
SQLX_OFFLINE: true
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
# </setup>
- run: cargo fmt -- --check
- run: cargo check --all-targets
- run: cargo clippy -- --deny warnings
spec-tests:
name: Spec tests
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust || 'stable' }}
targets: ${{ matrix.target }}
- name: Downloading ethereum/tests
run: git clone https://github.com/ethereum/tests ethereum-tests
- name: Downloading EELS fixtures released at Cancun
run: curl -LO https://github.com/ethereum/execution-spec-tests/releases/download/v2.1.1/fixtures.tar.gz && tar -xzf fixtures.tar.gz
- name: Test specs (EELS and ethereum/tests)
run: cargo test --features testing
tests:
name: Tests ${{ matrix.name }}
needs: [style]
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- name: linux / stable
- name: linux / beta
rust: beta
# - name: macOS / stable
# os: macOS-latest
# TODO: Support windows
# - name: windows / stable-x86_64-gnu
# os: windows-latest
# rust: stable-x86_64-pc-windows-gnu
# target: x86_64-pc-windows-gnu
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust || 'stable' }}
targets: ${{ matrix.target }}
- name: Setup docker (missing on MacOS)
if: runner.os == 'macos'
run: |
brew install docker
brew install docker-buildx
- name: Test docker
run: docker run hello-world
- name: Check
run: cargo check
- name: Test
run: cargo test -- --test-threads=1 --nocapture
docs:
name: Docs
runs-on: ubuntu-latest
env:
SQLX_OFFLINE: true
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
# </setup>
- name: Check documentation
run: cargo doc --no-deps --document-private-items --all-features
env:
RUSTDOCFLAGS: -D warnings
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
load: true
tags: blobshare:dev
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Test image
run: docker run --rm blobshare:dev --help