62 lines
1.4 KiB
YAML
62 lines
1.4 KiB
YAML
name: EasyTier Test
|
|
|
|
on:
|
|
push:
|
|
branches: ["develop", "main"]
|
|
paths:
|
|
- "easytier.toml"
|
|
- "easytier/**"
|
|
- "easytier-gui/**"
|
|
- ".github/workflows/test.yml"
|
|
pull_request:
|
|
branches: ["develop", "main"]
|
|
paths:
|
|
- "easytier.toml"
|
|
- "easytier/**"
|
|
- "easytier-gui/**"
|
|
- ".github/workflows/test.yml"
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
defaults:
|
|
run:
|
|
# necessary for windows
|
|
shell: bash
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup protoc
|
|
uses: arduino/setup-protoc@v2
|
|
with:
|
|
# GitHub repo token to use to avoid rate limiter
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Setup tools for test
|
|
run: sudo apt install bridge-utils
|
|
|
|
- name: Setup system for test
|
|
run: |
|
|
sudo sysctl net.bridge.bridge-nf-call-iptables=0
|
|
sudo sysctl net.bridge.bridge-nf-call-ip6tables=0
|
|
sudo sysctl net.ipv6.conf.lo.disable_ipv6=0
|
|
sudo ip addr add 2001:db8::2/64 dev lo
|
|
|
|
- name: Cargo cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo
|
|
./target
|
|
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Run tests
|
|
run: |
|
|
sudo -E env "PATH=$PATH" cargo test --verbose
|
|
sudo chown -R $USER:$USER ./target
|
|
sudo chown -R $USER:$USER ~/.cargo
|