Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
jmwample committed Oct 30, 2024
2 parents c483e42 + 150fe46 commit 351e327
Show file tree
Hide file tree
Showing 129 changed files with 4,385 additions and 1,371 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/build-nym-vpn-core-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@ jobs:
with:
toolchain: stable
components: rustfmt, clippy

- name: Install extra arch apple
run: |
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-ios
rustup target add x86_64-apple-ios
rustup target add aarch64-apple-ios-sim
targets: x86_64-apple-darwin aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim

- name: Setup cargo swift
run: |
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/build-nym-vpn-core-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ jobs:
with:
toolchain: stable
components: rustfmt, clippy

- name: Install extra arch apple
run: |
rustup target add x86_64-apple-darwin
targets: x86_64-apple-darwin aarch64-apple-darwin

- name: Install Go toochain
uses: actions/setup-go@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-nym-vpn-core-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
echo "moving binaries into ${{ env.UPLOAD_DIR_WINDOWS }}"
rm -rf ${{ env.UPLOAD_DIR_WINDOWS }} || true
mkdir ${{ env.UPLOAD_DIR_WINDOWS }}
cp -vpr ${{ env.SRC_BINARY }}/nym-gateway-probe.exe ${{ env.UPLOAD_DIR_WINDOWS }}
#cp -vpr ${{ env.SRC_BINARY }}/nym-gateway-probe.exe ${{ env.UPLOAD_DIR_WINDOWS }}
cp -vpr ${{ env.SRC_BINARY }}/nym-vpn-cli.exe ${{ env.UPLOAD_DIR_WINDOWS }}
cp -vpr ${{ env.SRC_BINARY }}/nym-vpnc.exe ${{ env.UPLOAD_DIR_WINDOWS }}
cp -vpr ${{ env.SRC_BINARY }}/nym-vpnd.exe ${{ env.UPLOAD_DIR_WINDOWS }}
Expand Down
30 changes: 27 additions & 3 deletions .github/workflows/build-wireguard-go-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,35 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
- name: Install build tools
shell: cmd
run: |
winget install --disable-interactivity --id=Microsoft.VisualStudio.2022.BuildTools --override "--wait --passive --add Microsoft.VisualStudio.Workload.VCTools;includeRecommended"
if %ERRORLEVEL% EQU -1978335189 (
exit /b 0
)
- name: Update path with vctools
shell: pwsh
run: |
$path = "$Env:ProgramFiles (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC"
$contents = Get-ChildItem $path | Select-Object -First 1
$subdir = $contents[0].Name
$vctoolsdir = "$path/$subdir/bin/Hostx64/x64"
echo "Add vctools dir to path: $vctoolsdir"
Add-Content $env:GITHUB_PATH "$vctoolsdir"
- name: Setup msys2
uses: msys2/setup-msys2@v2
with:
update: false
msystem: MINGW64
install: mingw-w64-x86_64-clang

- name: Build wireguard
shell: bash
shell: msys2 {0}
env:
MSYS2_PATH_TYPE: inherit
run: |
./wireguard/build-wireguard-go.sh
Expand Down
103 changes: 103 additions & 0 deletions .github/workflows/ci-nym-vpn-core-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: ci-nym-vpn-core-android

on:
# push:
pull_request:
paths:
- "nym-vpn-core/**"
- ".github/workflows/ci-nym-vpn-core-android.yml"
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
AGENT_ISSELFHOSTED: 1 # https://github.com/actions/setup-go/issues/432

jobs:
build:
runs-on: arc-ubuntu-22.04

steps:
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev libmnl-dev libnftnl-dev protobuf-compiler git curl gcc g++ make unzip

- name: Checkout repo
uses: actions/checkout@v4

- name: Install rust toolchain
uses: brndnmtthws/rust-action-rustup@v1
with:
toolchain: stable
components: rustfmt, clippy
targets: aarch64-linux-android

- name: Install cargo ndk
run: cargo install cargo-ndk

- name: Setup NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25c
add-to-path: false

- name: Set env
shell: bash
run: |
echo "ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >> $GITHUB_ENV
echo "NDK_TOOLCHAIN_DIR=${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_ENV
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "stable"

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "21.12" # 3.21.12: the version on ubuntu 24.04. Don't change this!
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build wireguard
run: ./wireguard/libwg/build-android.sh

- name: rustfmt check
working-directory: nym-vpn-core
run: |
cargo fmt --check
- name: Build
working-directory: nym-vpn-core
run: |
cargo ndk -t aarch64-linux-android -o ./build build -p nym-vpn-lib
- name: Generate uniffi
working-directory: nym-vpn-core
run: |
cargo run --bin uniffi-bindgen generate \
--library target/aarch64-linux-android/debug/libnym_vpn_lib.so \
--config crates/nym-vpn-lib/uniffi.toml \
--language kotlin --out-dir build -n
- name: Uniffi diff check
working-directory: nym-vpn-core
run: |
diff -B build/nym_vpn_lib/nym_vpn_lib.kt crates/nym-vpn-lib/uniffi/nym_vpn_lib.kt
continue-on-error: true
id: diff_android

- name: Upload generated uniffi file
if: steps.diff_android.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: updated-uniffi-android
path: nym-vpn-core/build/nym_vpn_lib/nym_vpn_lib.kt
retention-days: 1

- name: Fail workflow for uniffi
if: steps.diff_android.outcome == 'failure'
run: exit 1

- name: Clippy
working-directory: nym-vpn-core
run: |
cargo ndk -t aarch64-linux-android clippy -p nym-vpn-lib -- -Dwarning
94 changes: 94 additions & 0 deletions .github/workflows/ci-nym-vpn-core-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: ci-nym-vpn-core-ios

on:
# push:
pull_request:
paths:
- "nym-vpn-core/**"
- ".github/workflows/ci-nym-vpn-core-ios.yml"
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
AGENT_ISSELFHOSTED: 1 # https://github.com/actions/setup-go/issues/432

jobs:
build:
runs-on: custom-runner-mac-m1

steps:
- name: "Cleanup working directory"
shell: bash
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- name: Checkout repo
uses: actions/checkout@v4

- name: Install rust toolchain
uses: brndnmtthws/rust-action-rustup@v1
with:
toolchain: stable
components: rustfmt, clippy
targets: aarch64-apple-ios

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "stable"

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "21.12" # 3.21.12: the version on ubuntu 24.04. Don't change this!
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build wireguard
shell: bash
run: |
./wireguard/build-wireguard-go.sh --ios
- name: rustfmt check
working-directory: nym-vpn-core
run: |
cargo fmt --check
- name: Build
working-directory: nym-vpn-core
run: |
cargo build --verbose --target aarch64-apple-ios -p nym-vpn-lib
- name: Generate uniffi
working-directory: nym-vpn-core
run: |
cargo run --bin uniffi-bindgen generate \
--library target/aarch64-apple-ios/debug/libnym_vpn_lib.a \
--config crates/nym-vpn-lib/uniffi.toml \
--language swift --out-dir build -n
- name: Uniffi diff check
working-directory: nym-vpn-core
run: |
diff -B build/nym_vpn_lib.swift crates/nym-vpn-lib/uniffi/nym_vpn_lib.swift
continue-on-error: true
id: diff_ios

- name: Upload generated uniffi file
if: steps.diff_ios.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: updated-uniffi-ios
path: nym-vpn-core/build/nym_vpn_lib.swift
retention-days: 1

- name: Fail workflow for uniffi
if: steps.diff_ios.outcome == 'failure'
run: exit 1

- name: Clippy
working-directory: nym-vpn-core
run: |
cargo clippy --target aarch64-apple-ios -p nym-vpn-lib -- -Dwarnings
67 changes: 67 additions & 0 deletions .github/workflows/ci-nym-vpn-core-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: ci-nym-vpn-core-linux

on:
# push:
pull_request:
paths:
- "nym-vpn-core/**"
- ".github/workflows/ci-nym-vpn-core-linux.yml"
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
AGENT_ISSELFHOSTED: 1 # https://github.com/actions/setup-go/issues/432

jobs:
build:
runs-on: arc-ubuntu-22.04

steps:
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev libmnl-dev libnftnl-dev protobuf-compiler git curl gcc g++ make unzip

- name: Checkout repo
uses: actions/checkout@v4

- name: Install rust toolchain
uses: brndnmtthws/rust-action-rustup@v1
with:
toolchain: stable
components: rustfmt, clippy

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "stable"

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "21.12" # 3.21.12: the version on ubuntu 24.04. Don't change this!
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build wireguard
shell: bash
run: |
./wireguard/build-wireguard-go.sh
- name: rustfmt check
working-directory: nym-vpn-core
run: |
cargo fmt --check
- name: Build
working-directory: nym-vpn-core
run: |
cargo build --verbose
- name: Run tests
working-directory: nym-vpn-core
run: |
cargo test --verbose
- name: Clippy
working-directory: nym-vpn-core
run: |
cargo clippy -- -Dwarnings
Loading

0 comments on commit 351e327

Please sign in to comment.