Skip to content

Commit

Permalink
Merge pull request #2 from noctisynth/feat-workflows
Browse files Browse the repository at this point in the history
✨ 实现Workflow自动测试
  • Loading branch information
fu050409 authored Dec 24, 2023
2 parents 3e048a4 + d9d9827 commit a1cbce8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@ on:

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Update local toolchain
run: |
rustup update
- name: Toolchain info
run: |
cargo --version --verbose
rustc --version
- name: Lint
- name: Lint Code
run: |
cd .
cargo fmt -- --check
# cargo fmt -- --check
- name: Test
- name: Install Oblivion
env:
GH_TOKEN: ${{ secrets.QUANTUMIX_TOKEN }}
run: |
cd .
git clone --depth 1 https://${GH_TOKEN}@github.com/noctisynth/oblivion-rust.git
mv oblivion-rust oblivion
ls
- name: Test Project
run: |
cargo check
cargo test --all
- name: Build
- name: Build Quantumix-Server
run: |
cd .
cargo build --release
cargo build --release
9 changes: 3 additions & 6 deletions src/utils/email.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@ use regex::Regex;

pub fn is_valid_email(email: &str) -> bool {
let email_regex = Regex::new(r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$").unwrap();

if !email_regex.is_match(email) {
return false;
}

let parts: Vec<&str> = email.split('@').collect();

if parts.len() != 2 {
return false;
}

let domain = parts[1];


if domain != "tutanota.com" && domain != "tuta.com" {
false
} else {
true
}
matches!(domain, "tutanota.com" | "tuta.com")
}

0 comments on commit a1cbce8

Please sign in to comment.