Skip to content

Commit

Permalink
🧪 test components before build
Browse files Browse the repository at this point in the history
Test components before build
  • Loading branch information
petar-cvit authored Mar 16, 2024
2 parents 5fe642f + 9511268 commit df4e499
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 20 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,35 @@ permissions:
contents: write

jobs:
test-UI:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
- name: Install dependencies
run: |
cd ${{ github.workspace }}/cyclops-ui
npm install --force
- name: Run tests
run: |
cd ${{ github.workspace }}/cyclops-ui
npm test
test-controller:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Unit tests
run: |
cd ${{ github.workspace }}/cyclops-ctrl
make unit-test
build-UI:
needs:
- test-UI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -29,6 +57,8 @@ jobs:
docker push cyclopsui/cyclops-ui:$TAG
build-controller:
needs:
- test-controller
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/controller-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ on:
- 'cyclops-ctrl/**'

jobs:
build:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Unit tests
run: |
cd ${{ github.workspace }}/cyclops-ctrl
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/ui-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ on:
jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2

- name: Install dependencies
run: |
cd ${{ github.workspace }}/cyclops-ui
npm install --force
- name: Run tests
run: |
cd ${{ github.workspace }}/cyclops-ui
Expand Down
2 changes: 0 additions & 2 deletions cyclops-ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#==================== Building Stage ===================
FROM node:20.10.0-alpine as builder
WORKDIR /app

Expand All @@ -20,7 +19,6 @@ ENV VITE_APP_VERSION=$version
ENV NODE_OPTIONS=--max-old-space-size=1536
RUN yarn build

#==================== Nginx stage ======================
FROM nginx:stable-alpine as app

WORKDIR /usr/share/nginx/html
Expand Down
6 changes: 3 additions & 3 deletions cyclops-ui/src/components/k8s-resources/Deployment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "antd";
import axios from "axios";
import { formatPodAge } from "../../utils/pods";
import { DownloadOutlined } from "@ant-design/icons";
// import { DownloadOutlined } from "@ant-design/icons";
import ReactAce from "react-ace";

interface Props {
Expand Down Expand Up @@ -114,7 +114,7 @@ const Deployment = ({ name, namespace }: Props) => {
<Col>
<Button
type="primary"
icon={<DownloadOutlined />}
// icon={<DownloadOutlined />}
onClick={downloadLogs(container.name)}
>
Download
Expand All @@ -141,7 +141,7 @@ const Deployment = ({ name, namespace }: Props) => {
<Col>
<Button
type="primary"
icon={<DownloadOutlined />}
// icon={<DownloadOutlined />}
onClick={downloadLogs(container.name)}
>
Download
Expand Down
6 changes: 3 additions & 3 deletions cyclops-ui/src/components/k8s-resources/Pod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
TabsProps,
} from "antd";
import axios from "axios";
import { DownloadOutlined } from "@ant-design/icons";
// import { DownloadOutlined } from "@ant-design/icons";
import ReactAce from "react-ace";
import { formatPodAge } from "../../utils/pods";
const { Title } = Typography;
Expand Down Expand Up @@ -135,7 +135,7 @@ const Pod = ({ name, namespace }: Props) => {
<Col>
<Button
type="primary"
icon={<DownloadOutlined />}
// icon={<DownloadOutlined />}
onClick={downloadLogs(container.name)}
>
Download
Expand All @@ -162,7 +162,7 @@ const Pod = ({ name, namespace }: Props) => {
<Col>
<Button
type="primary"
icon={<DownloadOutlined />}
// icon={<DownloadOutlined />}
onClick={downloadLogs(container.name)}
>
Download
Expand Down
6 changes: 3 additions & 3 deletions cyclops-ui/src/components/k8s-resources/StatefulSet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "antd";
import axios from "axios";
import { formatPodAge } from "../../utils/pods";
import { DownloadOutlined } from "@ant-design/icons";
// import { DownloadOutlined } from "@ant-design/icons";
import ReactAce from "react-ace";

interface Props {
Expand Down Expand Up @@ -114,7 +114,7 @@ const StatefulSet = ({ name, namespace }: Props) => {
<Col>
<Button
type="primary"
icon={<DownloadOutlined />}
// icon={<DownloadOutlined />}
onClick={downloadLogs(container.name)}
>
Download
Expand All @@ -141,7 +141,7 @@ const StatefulSet = ({ name, namespace }: Props) => {
<Col>
<Button
type="primary"
icon={<DownloadOutlined />}
// icon={<DownloadOutlined />}
onClick={downloadLogs(container.name)}
>
Download
Expand Down
4 changes: 2 additions & 2 deletions install/cyclops-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ spec:
spec:
containers:
- name: cyclops-ui
image: cyclopsui/cyclops-ui:v0.2.0-rc.1
image: cyclopsui/cyclops-ui:v0.2.0-rc.2
ports:
- containerPort: 80
env:
Expand Down Expand Up @@ -379,7 +379,7 @@ spec:
serviceAccountName: cyclops-ctrl
containers:
- name: cyclops-ctrl
image: cyclopsui/cyclops-ctrl:v0.2.0-rc.1
image: cyclopsui/cyclops-ctrl:v0.2.0-rc.2
ports:
- containerPort: 8080
env:
Expand Down

0 comments on commit df4e499

Please sign in to comment.