-
-
Notifications
You must be signed in to change notification settings - Fork 11
77 lines (74 loc) · 2.51 KB
/
rust.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
name: Pact Plugin Driver (Rust)
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-12 ]
env:
pact_do_not_track: true
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install plugin cli
run: scripts/install-plugin-cli.sh
shell: bash
- name: Install Protobuf plugin
run: ~/.pact/bin/pact-plugin-cli -y install protobuf
shell: bash
- name: Install csv plugin
run: ~/.pact/bin/pact-plugin-cli -y install csv
shell: bash
- name: Tests
run: cargo test
working-directory: drivers/rust/driver
env:
RUST_LOG: trace
RUST_BACKTRACE: 1
- name: FFI Tests
run: cargo test
working-directory: drivers/rust/driver_ffi
env:
RUST_LOG: trace
RUST_BACKTRACE: 1
- name: Pact Tests
run: cargo test
working-directory: drivers/rust/driver_pact_tests
env:
RUST_LOG: trace
RUST_BACKTRACE: 1
- name: Build Components
uses: marcopolo/cargo@master
with:
working-directory: drivers/rust/driver
command: build
- name: Clippy
uses: marcopolo/cargo@master
with:
working-directory: drivers/rust/driver
command: clippy
if: runner.os == 'Linux'
- name: Publish pact files
run: |
curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.88.77/pact-1.88.77-linux-x86_64.tar.gz
tar xzf pact-1.88.77-linux-x86_64.tar.gz
VER=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
pact/bin/pact-broker publish -a "$VER+$GITHUB_SHA" -b https://pact-foundation.pactflow.io -k ${{ secrets.PACTFLOW_TOKEN }} target/pacts
working-directory: drivers/rust/driver_pact_tests
if: runner.os == 'Linux'
musl-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
docker run --rm -v $(pwd):/workspace -w /workspace/drivers/rust/driver -t \
-e 'RUST_LOG=trace' -e 'pact_do_not_track=true' pactfoundation/rust-musl-build \
-c ./musl-build.sh