-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0a458a
commit 9fc8ff0
Showing
8 changed files
with
194 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: full CI | ||
|
||
on: | ||
merge_group: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
style_check: | ||
name: Style check | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Rust toolchain | ||
run: sh ./ci/install-rust.sh | ||
- name: Check style | ||
run: sh ci/style.sh | ||
|
||
build_channels_linux: | ||
name: Build Channels Linux | ||
runs-on: ubuntu-22.04 | ||
env: | ||
OS: linux | ||
strategy: | ||
fail-fast: true | ||
max-parallel: 2 | ||
matrix: | ||
toolchain: | ||
- stable | ||
- 1.66.0 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Rust toolchain | ||
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh | ||
- name: Execute run.sh | ||
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/usr/bin/env sh | ||
# This is intended to be used in CI only. | ||
|
||
set -ex | ||
|
||
echo "Setup toolchain" | ||
toolchain= | ||
if [ -n "$TOOLCHAIN" ]; then | ||
toolchain=$TOOLCHAIN | ||
else | ||
toolchain=stable | ||
fi | ||
if [ "$OS" = "windows" ]; then | ||
: "${TARGET?The TARGET environment variable must be set.}" | ||
rustup set profile minimal | ||
rustup update --force "$toolchain-$TARGET" | ||
rustup default "$toolchain-$TARGET" | ||
else | ||
rustup set profile minimal | ||
rustup update --force "$toolchain" | ||
rustup default "$toolchain" | ||
fi | ||
|
||
if [ -n "$TARGET" ]; then | ||
echo "Install target" | ||
rustup target add "$TARGET" | ||
fi | ||
|
||
if [ -n "$INSTALL_RUST_SRC" ]; then | ||
echo "Install rust-src" | ||
rustup component add rust-src | ||
fi | ||
|
||
if [ "$OS" = "windows" ]; then | ||
if [ "$ARCH_BITS" = "i686" ]; then | ||
echo "Install MinGW32" | ||
choco install mingw --x86 --force | ||
fi | ||
|
||
echo "Find GCC libraries" | ||
gcc -print-search-dirs | ||
/usr/bin/find "C:\ProgramData\Chocolatey" -name "crt2*" | ||
/usr/bin/find "C:\ProgramData\Chocolatey" -name "dllcrt2*" | ||
/usr/bin/find "C:\ProgramData\Chocolatey" -name "libmsvcrt*" | ||
|
||
if [ -n "$ARCH_BITS" ]; then | ||
echo "Fix MinGW" | ||
for i in crt2.o dllcrt2.o libmingwex.a libmsvcrt.a ; do | ||
cp -f "/C/ProgramData/Chocolatey/lib/mingw/tools/install/mingw$ARCH_BITS/$ARCH-w64-mingw32/lib/$i" "$(rustc --print sysroot)/lib/rustlib/$TARGET/lib" | ||
done | ||
fi | ||
|
||
# Install Wintun | ||
echo "Install Wintun" | ||
curl.exe -o wintun.zip https://www.wintun.net/builds/wintun-0.14.1.zip | ||
powershell.exe -NoP -NonI -Command "Expand-Archive './wintun.zip' './'" | ||
cp -f "./wintun/bin/amd64/wintun.dll" "./" | ||
rm -rf "./wintun" | ||
fi | ||
|
||
echo "Query rust and cargo versions" | ||
command -v rustc | ||
command -v cargo | ||
command -v rustup | ||
rustc -Vv | ||
cargo -V | ||
rustup -Vv | ||
rustup show | ||
|
||
echo "Generate lockfile" | ||
N=5 | ||
n=0 | ||
until [ $n -ge $N ] | ||
do | ||
if cargo generate-lockfile; then | ||
break | ||
fi | ||
n=$((n+1)) | ||
sleep 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Builds and runs tests for a particular target passed as an argument to this | ||
# script. | ||
|
||
set -ex | ||
|
||
: "${TOOLCHAIN?The TOOLCHAIN environment variable must be set.}" | ||
: "${OS?The OS environment variable must be set.}" | ||
|
||
RUST=${TOOLCHAIN} | ||
|
||
echo "Testing Rust ${RUST} on ${OS}" | ||
|
||
# FIXME: rustup often fails to download some artifacts due to network | ||
# issues, so we retry this N times. | ||
N=5 | ||
n=0 | ||
until [ $n -ge $N ] | ||
do | ||
if rustup override set "${RUST}" ; then | ||
break | ||
fi | ||
n=$((n+1)) | ||
sleep 1 | ||
done | ||
|
||
case "${OS}" in | ||
windows*) | ||
cargo test --features wintun | ||
|
||
cargo test --features wintun-runtime | ||
|
||
cargo test --features tapwin6 | ||
|
||
cargo test --features tapwin6-runtime | ||
;; | ||
*) | ||
# No extra features in any platform other than windows | ||
|
||
cargo test | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -ex | ||
|
||
rustup toolchain install nightly -c rustfmt --allow-downgrade | ||
rustup override set nightly | ||
command -v rustfmt | ||
rustfmt -V | ||
cargo fmt --all -- --check | ||
|
||
if shellcheck --version ; then | ||
# GHA's shellcheck is too old (0.4.6) and cannot handle SC2153 correctly. | ||
shellcheck -e SC2103 -e SC2153 ci/*.sh | ||
else | ||
echo "shellcheck not found" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters