Skip to content

Commit

Permalink
Merge pull request #20 from Gaucho-Racing/bk1031/gh-actions
Browse files Browse the repository at this point in the history
Update GH Actions
  • Loading branch information
BK1031 authored May 6, 2024
2 parents 6c99a95 + 1928c76 commit 1ada44c
Show file tree
Hide file tree
Showing 21 changed files with 224 additions and 207 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/dashboard-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Dashboard Tests
run-name: Triggered by ${{ github.event_name }} to ${{ github.ref }} by @${{ github.actor }}

on: [push]

jobs:
dashboard_build_job:
runs-on: ubuntu-latest
name: Build
defaults:
run:
working-directory: ./dashboard
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Install dependencies
run: |
npm ci
- name: Run build
run: |
npm run build
dashboard_lint_job:
runs-on: ubuntu-latest
name: Lint
defaults:
run:
working-directory: ./dashboard
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Install dependencies
run: |
npm ci
- name: Run lint
run: |
npm run lint
dashboard_check_job:
runs-on: ubuntu-latest
name: Prettier Check
defaults:
run:
working-directory: ./dashboard
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Install dependencies
run: |
npm ci
- name: Run check
run: |
npm run check
35 changes: 35 additions & 0 deletions .github/workflows/ingest-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Ingest Tests
run-name: Triggered by ${{ github.event_name }} to ${{ github.ref }} by @${{ github.actor }}

on: [push]

jobs:
ingest_test_job:
runs-on: ubuntu-latest
name: Unit Tests
defaults:
run:
working-directory: ./ingest
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.22.0'
- name: Install dependencies
run: |
go get .
- name: Run tests
run: |
. ./scripts/test-env.sh
sh scripts/test.sh
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./ingest/coverage.out
verbose: true
34 changes: 2 additions & 32 deletions .github/workflows/tests.yml → .github/workflows/rigby-tests.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Mapache Tests
name: Rigby Tests
run-name: Triggered by ${{ github.event_name }} to ${{ github.ref }} by @${{ github.actor }}

on: [push]

jobs:
rigby_test_job:
runs-on: ubuntu-latest
name: Test Rigby
name: Unit Tests
defaults:
run:
working-directory: ./rigby
Expand Down Expand Up @@ -37,34 +37,4 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./rigby/coverage.lcov
verbose: true

ingest_test_job:
runs-on: ubuntu-latest
name: Test Ingest
defaults:
run:
working-directory: ./ingest
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.22.0'
- name: Install dependencies
run: |
go get .
- name: Run tests
run: |
. ./scripts/test-env.sh
sh scripts/test.sh
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./ingest/coverage.out
verbose: true
7 changes: 3 additions & 4 deletions dashboard/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ module.exports = {
parser: "@typescript-eslint/parser",
plugins: ["react-refresh"],
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"@typescript-eslint/no-explicit-any": ["off"],
"react-refresh/only-export-components": ["off"],
"react-hooks/exhaustive-deps": ["off"],
},
};
2 changes: 1 addition & 1 deletion dashboard/.vite/deps/_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"browserHash": "efeb9fa0",
"optimized": {},
"chunks": {}
}
}
7 changes: 7 additions & 0 deletions dashboard/package-lock.json

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

1 change: 1 addition & 0 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@types/crypto-js": "^4.2.2",
"@types/node": "^20.11.0",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
Expand Down
26 changes: 1 addition & 25 deletions dashboard/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "./App.css";
import React, { useReducer } from "react";
import React from "react";
import axios from "axios";
import { MAPACHE_API_URL } from "./consts/config";
import { Button } from "./components/ui/button";
Expand All @@ -11,42 +11,18 @@ import {
getAxiosErrorMessage,
} from "./lib/axios-error-handler";
import { useNavigate } from "react-router-dom";
import { checkCredentials } from "./lib/auth";

function App() {
const navigate = useNavigate();
const [, forceUpdate] = useReducer((x) => x + 1, 0);

const [connected, setConnected] = React.useState(false);
const [pingResponse, setPingResponse] = React.useState<any>({});

const [loginLoading, setLoginLoading] = React.useState(false);
const [loginEmail, setLoginEmail] = React.useState("");
const [loginPassword, setLoginPassword] = React.useState("");

React.useEffect(() => {
init();
checkVpnConnection();
const interval = setInterval(() => {
// checkVpnConnection();
}, 1000);

return () => clearInterval(interval);
}, []);

const checkVpnConnection = async () => {
try {
const response = await axios.get(`${MAPACHE_API_URL}/ping`);
if (response.status == 200) {
setConnected(true);
setPingResponse(response.data);
}
} catch (error) {
setConnected(false);
return;
}
};

const init = async () => {
if (
localStorage.getItem("id") != null &&
Expand Down
2 changes: 0 additions & 2 deletions dashboard/src/components/DashboardHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Separator } from "./ui/separator";
import { Button } from "@/components/ui/button";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
Expand Down
24 changes: 12 additions & 12 deletions dashboard/src/components/ui/avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react"
import * as AvatarPrimitive from "@radix-ui/react-avatar"
import * as React from "react";
import * as AvatarPrimitive from "@radix-ui/react-avatar";

import { cn } from "@/lib/utils"
import { cn } from "@/lib/utils";

const Avatar = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Root>,
Expand All @@ -11,12 +11,12 @@ const Avatar = React.forwardRef<
ref={ref}
className={cn(
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
className
className,
)}
{...props}
/>
))
Avatar.displayName = AvatarPrimitive.Root.displayName
));
Avatar.displayName = AvatarPrimitive.Root.displayName;

const AvatarImage = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Image>,
Expand All @@ -27,8 +27,8 @@ const AvatarImage = React.forwardRef<
className={cn("aspect-square h-full w-full", className)}
{...props}
/>
))
AvatarImage.displayName = AvatarPrimitive.Image.displayName
));
AvatarImage.displayName = AvatarPrimitive.Image.displayName;

const AvatarFallback = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Fallback>,
Expand All @@ -38,11 +38,11 @@ const AvatarFallback = React.forwardRef<
ref={ref}
className={cn(
"flex h-full w-full items-center justify-center rounded-full bg-slate-100 dark:bg-slate-800",
className
className,
)}
{...props}
/>
))
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
));
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;

export { Avatar, AvatarImage, AvatarFallback }
export { Avatar, AvatarImage, AvatarFallback };
Loading

0 comments on commit 1ada44c

Please sign in to comment.