Skip to content

Commit

Permalink
Add Basic CI
Browse files Browse the repository at this point in the history
Adding Secrets to CI

CI didn't like that

CI Still Not Happy

Never Have I Ever

Seen a CI refuse to use my secrets

Make CI Happy
  • Loading branch information
Proziam authored and Eric Biggs committed Sep 10, 2024
1 parent 99663d8 commit b27fb01
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 10 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Rust

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
# - beta
# - nightly

env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_API_KEY: ${{ secrets.SUPABASE_API_KEY }}
SUPABASE_JWT_SECRET: ${{ secrets.SUPABASE_JWT_SECRET }}

steps:
- uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose

2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions tests/client_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async fn create_client_test_valid() {
#[tokio::test]
async fn sign_in_with_password_test_valid() {
let test_project_url = env::var("SUPABASE_URL").unwrap();
let test_api_key = env::var("SUPABASE_API").unwrap();
let test_api_key = env::var("SUPABASE_API_KEY").unwrap();
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap();

let auth_client = AuthClient::new(
Expand All @@ -47,7 +47,7 @@ async fn sign_in_with_password_test_valid() {
#[tokio::test]
async fn sign_in_with_password_test_invalid() {
let test_project_url = env::var("SUPABASE_URL").unwrap();
let test_api_key = env::var("SUPABASE_API").unwrap();
let test_api_key = env::var("SUPABASE_API_KEY").unwrap();
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap();

let auth_client = AuthClient::new(
Expand All @@ -73,7 +73,7 @@ async fn sign_in_with_password_test_invalid() {
#[tokio::test]
async fn sign_up_with_email_test_valid() {
let test_project_url = env::var("SUPABASE_URL").unwrap();
let test_api_key = env::var("SUPABASE_API").unwrap();
let test_api_key = env::var("SUPABASE_API_KEY").unwrap();
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap();

let auth_client = AuthClient::new(
Expand Down Expand Up @@ -105,7 +105,7 @@ async fn sign_up_with_email_test_valid() {
#[tokio::test]
async fn sign_up_with_phone_test_valid() {
let test_project_url = env::var("SUPABASE_URL").unwrap();
let test_api_key = env::var("SUPABASE_API").unwrap();
let test_api_key = env::var("SUPABASE_API_KEY").unwrap();
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap();

let auth_client = AuthClient::new(
Expand Down Expand Up @@ -135,7 +135,7 @@ async fn sign_up_with_phone_test_valid() {
#[tokio::test]
async fn send_login_email_with_magic_link() {
let test_project_url = env::var("SUPABASE_URL").unwrap();
let test_api_key = env::var("SUPABASE_API").unwrap();
let test_api_key = env::var("SUPABASE_API_KEY").unwrap();
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap();

let auth_client = AuthClient::new(
Expand Down Expand Up @@ -164,7 +164,7 @@ async fn send_login_email_with_magic_link() {
#[tokio::test]
async fn send_sms_with_otp() {
let test_project_url = env::var("SUPABASE_URL").unwrap();
let test_api_key = env::var("SUPABASE_API").unwrap();
let test_api_key = env::var("SUPABASE_API_KEY").unwrap();
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap();

let auth_client = AuthClient::new(
Expand All @@ -191,7 +191,7 @@ async fn send_sms_with_otp() {
#[tokio::test]
async fn sign_in_with_oauth_test() {
let test_project_url = env::var("SUPABASE_URL").unwrap();
let test_api_key = env::var("SUPABASE_API").unwrap();
let test_api_key = env::var("SUPABASE_API_KEY").unwrap();
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap();

let auth_client = AuthClient::new(
Expand Down Expand Up @@ -231,7 +231,7 @@ async fn sign_in_with_oauth_test() {
#[tokio::test]
async fn get_user_test() {
let test_project_url = env::var("SUPABASE_URL").unwrap();
let test_api_key = env::var("SUPABASE_API").unwrap();
let test_api_key = env::var("SUPABASE_API_KEY").unwrap();
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap();

let auth_client = AuthClient::new(
Expand Down Expand Up @@ -264,7 +264,7 @@ async fn get_user_test() {
#[tokio::test]
async fn update_user_test() {
let test_project_url = env::var("SUPABASE_URL").unwrap();
let test_api_key = env::var("SUPABASE_API").unwrap();
let test_api_key = env::var("SUPABASE_API_KEY").unwrap();
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap();

let auth_client = AuthClient::new(
Expand Down

0 comments on commit b27fb01

Please sign in to comment.