Skip to content

Commit

Permalink
Added CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ancwrd1 committed Dec 15, 2024
1 parent 9061fe4 commit 537e756
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI

on: [push, pull_request]

jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git submodule update --init
- run: sudo apt-get update && sudo apt-get install -yqq build-essential pkg-config libssl-dev libgtk-3-dev
- run: ci/set_rust_version.bash ${{ matrix.channel }} ${{ matrix.target }}
- run: ci/clippy.bash cargo ${{ matrix.target }}
- run: ci/test.bash cargo ${{ matrix.target }}

strategy:
fail-fast: false
matrix:
channel: [stable]
target:
- x86_64-unknown-linux-gnu
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Open Source Linux Client for Check Point VPN Tunnels

[![github actions](https://github.com/ancwrd1/snx-rs/workflows/CI/badge.svg)](https://github.com/ancwrd1/snx-rs/actions)
[![license](https://img.shields.io/badge/License-AGPL-v3.svg)](https://opensource.org/license/agpl-v3)

This project contains the source code for an unofficial Linux client for Check Point VPN, written in Rust.

## Advantages Over the Official SNX Client for Linux
Expand Down
22 changes: 22 additions & 0 deletions ci/build.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Script for building your rust projects.
set -e

source ci/common.bash

# $1 {path} = Path to cross/cargo executable
CROSS=$1
# $2 {string} = <Target Triple>
TARGET_TRIPLE=$2
# $3 {boolean} = Whether or not building for release or not.
RELEASE_BUILD=$3

required_arg "$CROSS" 'CROSS'
required_arg "$TARGET_TRIPLE" '<Target Triple>'

if [ -z "$RELEASE_BUILD" ]; then
$CROSS build --target "$TARGET_TRIPLE" --workspace
$CROSS build --target "$TARGET_TRIPLE" --all-features --workspace
else
$CROSS build --target $TARGET_TRIPLE --all-features --release --workspace
fi
15 changes: 15 additions & 0 deletions ci/clippy.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Script for building your rust projects.
set -e

source ci/common.bash

# $1 {path} = Path to cross/cargo executable
CROSS=$1
# $2 {string} = <Target Triple>
TARGET_TRIPLE=$2

required_arg "$CROSS" 'CROSS'
required_arg "$TARGET_TRIPLE" '<Target Triple>'

$CROSS clippy --target "$TARGET_TRIPLE" --all-features --workspace
6 changes: 6 additions & 0 deletions ci/common.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
required_arg() {
if [ -z "$1" ]; then
echo "Required argument $2 missing"
exit 1
fi
}
5 changes: 5 additions & 0 deletions ci/set_rust_version.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
rustup update
rustup default "$1"
rustup target add "$2"
16 changes: 16 additions & 0 deletions ci/test.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Script for building your rust projects.
set -e

source ci/common.bash

# $1 {path} = Path to cross/cargo executable
CROSS=$1
# $2 {string} = <Target Triple>
TARGET_TRIPLE=$2

required_arg "$CROSS" 'CROSS'
required_arg "$TARGET_TRIPLE" '<Target Triple>'

$CROSS test --target "$TARGET_TRIPLE" --workspace
$CROSS build --target "$TARGET_TRIPLE" --all-features --workspace

0 comments on commit 537e756

Please sign in to comment.