-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (135 loc) · 6.5 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
144
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
name: Test
jobs:
dump-ctx:
name: Context
runs-on: ubuntu-latest
steps:
- name: Dump Github context
uses: crazy-max/ghaction-dump-context@v2
build-and-release:
name: Build and Test
strategy:
fail-fast: false
matrix:
target:
# BSDs
#- { platform: aarch64-unknown-freebsd, os: linux, runner: ubuntu-latest, run: true } # No rust core
- { platform: i686-unknown-freebsd, os: linux, runner: ubuntu-latest, run: false }
- { platform: x86_64-unknown-freebsd, os: linux, runner: ubuntu-latest, run: false }
#- { platform: aarch64-unknown-netbsd, os: linux, runner: ubuntu-latest, run: true } # No rust core
- { platform: x86_64-unknown-netbsd, os: linux, runner: ubuntu-latest, run: false }
# WASM
#- { platform: wasm32-wasi, os: linux, runner: ubuntu-latest, run: true } # Incompatible Tokio
# Android (redundant with Linux Musl)
# - { platform: aarch64-linux-android, os: linux, runner: ubuntu-latest, run: true }
# - { platform: arm-linux-androideabi, os: linux, runner: ubuntu-latest, run: true }
# - { platform: i686-linux-android, os: linux, runner: ubuntu-latest, run: true }
# - { platform: x86_64-linux-android, os: linux, runner: ubuntu-latest, run: true }
# Linux Musl
- { platform: aarch64-unknown-linux-musl, os: linux, runner: ubuntu-latest, run: true }
- { platform: arm-unknown-linux-musleabi, os: linux, runner: ubuntu-latest, run: true }
#- { platform: i586-unknown-linux-musl, os: linux, runner: ubuntu-latest, run: true } # Incompatible Ring: no SSE
- { platform: i686-unknown-linux-musl, os: linux, runner: ubuntu-latest, run: true }
- { platform: x86_64-unknown-linux-musl, os: linux, runner: ubuntu-latest, run: true }
# Linux GNU
# Redundant with Linux Musl
# - { platform: aarch64-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
# - { platform: arm-unknown-linux-gnueabi, os: linux, runner: ubuntu-latest, run: true }
# #- { platform: i586-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true } # Incompatible Ring: no SSE
# - { platform: i686-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
# - { platform: x86_64-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
#- { platform: mips-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true } # No rust core
#- { platform: mips64-unknown-linux-gnuabi64, os: linux, runner: ubuntu-latest, run: true } # No rust core, Incompatible Ring: unknown Arch
- { platform: powerpc-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
- { platform: powerpc64-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
#- { platform: riscv32gc-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true } # No rust core, Incompatible Ring: unknown Arch
- { platform: riscv64gc-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
- { platform: s390x-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
#- { platform: sparc-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true } # Incompatible Ring: unknown Arch
#- { platform: sparc64-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true } # Incompatible Ring: unknown Arch
# MacOS
- { platform: aarch64-apple-darwin, os: darwin, runner: macos-latest, run: true }
- { platform: x86_64-apple-darwin, os: darwin, runner: macos-latest, run: true }
# Windows
- { platform: aarch64-pc-windows-msvc, os: windows, runner: windows-latest, run: false }
#- { platform: i586-pc-windows-msvc, os: windows, runner: windows-latest, run: true } # Incompatible Ring: no SSE
- { platform: i686-pc-windows-msvc, os: windows, runner: windows-latest, run: true }
- { platform: x86_64-pc-windows-msvc, os: windows, runner: windows-latest, run: true }
toolchain:
- stable
- nightly
runs-on: ${{ matrix.target.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with:
tool: protoc,sccache
- name: Install toolchain
if: ${{ !contains(matrix.toolchain, 'nightly') }}
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target.platform }}
toolchain: ${{ matrix.toolchain }}
components: rust-src,rust-docs,rustfmt,clippy
- name: Install toolchain (with miri)
if: contains(matrix.toolchain, 'nightly')
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target.platform }}
toolchain: ${{ matrix.toolchain }}
components: rust-src,rust-docs,rustfmt,clippy,miri
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target.platform }}
- name: Install terraform
if: matrix.target.run
uses: hashicorp/setup-terraform@v3
- name: Setup Cache
uses: Swatinem/[email protected]
with:
shared-key: "build-${{ matrix.toolchain }}-${{ matrix.target.platform }}"
- name: Build
run: |
cargo build --all --locked
- name: Build Examples
run: |
cargo build --examples --locked
- name: Test
if: matrix.target.run
run: |
cargo test --all --locked
- name: Test Release
if: matrix.target.run
run: |
cargo test --all --locked --release
- name: Test Miri
if: contains(matrix.toolchain, 'nightly')
run: |
cargo miri test --all --locked
- name: Test Examples
if: matrix.target.run
shell: bash
run: |
rm terraform.d/bin
ln -s ../target/${{ matrix.target.platform }}/debug/examples terraform.d/bin
for d in examples/*/; do
(
cd "$d"
terraform init
terraform apply -auto-approve
terraform destroy -auto-approve
)
done
- name: Format
run: |
cargo fmt --all --check
- name: Clippy
run: |
cargo clippy --all --no-deps -- -Dwarnings -Dunused-crate-dependencies