-
Notifications
You must be signed in to change notification settings - Fork 8
101 lines (96 loc) · 3.47 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
92
93
94
95
96
97
98
99
100
101
name: Pact-Protobuf-Plugin Build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-12 ]
rust: [ stable ]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
components: clippy
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install shared mime info DB
if: runner.os == 'macOS'
run: brew install shared-mime-info
- name: Clippy
run: cargo clippy
if: runner.os == 'Linux'
- name: Unit Tests
run: cargo test --lib
env:
RUST_LOG: debug
RUST_BACKTRACE: 1
- name: Build Plugin
run: cargo build
- name: Integration Tests
run: |
mkdir -p ~/.pact/plugins/protobuf-debug
cp pact-plugin.json target/debug/pact-protobuf-plugin ~/.pact/plugins/protobuf-debug/
cargo test --test '*' -- --skip verify_plugin
env:
RUST_LOG: debug
RUST_BACKTRACE: 1
shell: bash
musl-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
docker run --rm --user "$(id -u)":"$(id -g)" -v $(pwd):/workspace -w /workspace -t pactfoundation/rust-musl-build:1.77.1 ./scripts/musl-build.sh
pact-verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build plugin
run: cargo build
- name: Install plugin
run: |
mkdir -p ~/.pact/plugins/pact-protobuf-plugin
cp pact-plugin.json target/debug/pact-protobuf-plugin ~/.pact/plugins/pact-protobuf-plugin/
- name: Pact verification test
run: cargo test --test pact_verify
env:
RUST_LOG: debug
RUST_BACKTRACE: 1
PACTFLOW_TOKEN: ${{ secrets.PACTFLOW_TOKEN }}
integrated-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build plugin
run: cargo build
- name: Install plugin
run: |
mkdir -p ~/.pact/plugins/pact-protobuf-plugin
cp pact-plugin.json target/debug/pact-protobuf-plugin ~/.pact/plugins/pact-protobuf-plugin/
- name: Run integrated test examples
run: |
pushd integrated_tests/default_values && cargo test && popd
pushd integrated_tests/imported_message && cargo test && popd
pushd integrated_tests/imported_message_same_package_multiple_files && cargo test && popd
pushd integrated_tests/imported_without_package && cargo test && popd
pushd integrated_tests/matching_maps && cargo test && popd
pushd integrated_tests/new_fields/consumer && cargo test && popd
pushd integrated_tests/new_fields/old_provider && cargo test && popd
pushd integrated_tests/new_fields/new_provider && cargo test && popd
pushd integrated_tests/repeated_enums && cargo test && popd
pushd integrated_tests/response_metadata && cargo test && popd
env:
RUST_LOG: debug
RUST_BACKTRACE: 1