4040 - name : Install system dependencies
4141 run : sudo apt-get update && sudo apt-get install -y libpcsclite-dev
4242
43+ - name : Install Rust toolchain
44+ uses : dtolnay/rust-toolchain@stable
45+
46+ - name : Build Rust spelldict library
47+ run : cargo build --release --manifest-path clib/spelldict/Cargo.toml
48+
4349 - name : Wait for greenmail
4450 run : |
4551 for i in $(seq 1 60); do
5965 MATCHA_TEST_IMAP_PORT : " 3993"
6066 MATCHA_TEST_SMTP_PORT : " 3465"
6167 MATCHA_TEST_API_PORT : " 8080"
68+ CGO_LDFLAGS : -L${{ github.workspace }}/clib/spelldict/target/release
6269 run : |
6370 go test -v -tags=integration -timeout=10m -count=1 ./tests/integration/...
6471
8188 if : runner.os == 'Linux'
8289 run : sudo apt-get update && sudo apt-get install -y libpcsclite-dev
8390
91+ - name : Install Rust toolchain
92+ uses : dtolnay/rust-toolchain@stable
93+ with :
94+ targets : ${{ runner.os == 'Windows' && 'x86_64-pc-windows-gnu' || '' }}
95+
96+ - name : Build Rust spelldict library
97+ shell : bash
98+ run : |
99+ WORKSPACE="$(pwd)"
100+ if [ "$RUNNER_OS" = "Windows" ]; then
101+ CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=gcc \
102+ cargo build --release --manifest-path clib/spelldict/Cargo.toml --target x86_64-pc-windows-gnu
103+ # cygpath -m converts the Git Bash POSIX path (/d/a/...) to a Windows
104+ # mixed path (D:/a/...) that MinGW's ld.exe can actually resolve.
105+ echo "SPELLDICT_LIB=$(cygpath -m "${WORKSPACE}/clib/spelldict/target/x86_64-pc-windows-gnu/release")" >> "$GITHUB_ENV"
106+ else
107+ cargo build --release --manifest-path clib/spelldict/Cargo.toml
108+ echo "SPELLDICT_LIB=${WORKSPACE}/clib/spelldict/target/release" >> "$GITHUB_ENV"
109+ fi
110+
84111 - name : Race-enabled unit tests
112+ env :
113+ CGO_LDFLAGS : -L${{ env.SPELLDICT_LIB }}
85114 run : go test -race -timeout=10m ./...
86115
87116 fuzz :
@@ -99,6 +128,12 @@ jobs:
99128 - name : Install system dependencies
100129 run : sudo apt-get update && sudo apt-get install -y libpcsclite-dev
101130
131+ - name : Install Rust toolchain
132+ uses : dtolnay/rust-toolchain@stable
133+
134+ - name : Build Rust spelldict library
135+ run : cargo build --release --manifest-path clib/spelldict/Cargo.toml
136+
102137 - name : Discover fuzz targets
103138 id : discover
104139 run : |
@@ -114,6 +149,8 @@ jobs:
114149
115150 - name : Run fuzz targets (30s each)
116151 if : steps.discover.outputs.targets != ''
152+ env :
153+ CGO_LDFLAGS : -L${{ github.workspace }}/clib/spelldict/target/release
117154 run : |
118155 for file in ${{ steps.discover.outputs.targets }}; do
119156 dir=$(dirname "$file")
0 commit comments