Skip to content

Commit 1045e38

Browse files
authored
ci: Add a CI workflow for pull requests (#33)
* feat(ci): add CI workflow for pull requests * chore: update dependencies
1 parent 82871fc commit 1045e38

File tree

18 files changed

+20742
-15612
lines changed

18 files changed

+20742
-15612
lines changed

.github/workflows/ci.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build-and-test:
8+
runs-on: ubuntu-latest
9+
defaults:
10+
run:
11+
shell: nix develop --command bash {0}
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- uses: DeterminateSystems/nix-installer-action@main
17+
- uses: DeterminateSystems/magic-nix-cache-action@main
18+
- uses: DeterminateSystems/flake-checker-action@main
19+
20+
- name: Install dependencies
21+
run: yarn install --immutable
22+
23+
- name: Lint
24+
run: just lint
25+
26+
- name: Test
27+
run: just test
28+
29+
- name: Type Check
30+
run: yarn tsc
31+
32+
- name: Build
33+
run: yarn build

.github/workflows/release.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
changes: ${{ steps.check_changes.outputs.changes }}
2626
release:
2727
runs-on: ubuntu-latest
28+
needs: [ check-changes ]
2829
if: needs.check-changes.outputs.changes == 'detected'
2930
defaults:
3031
run:

backstage.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"version": "1.45.3"
3+
}

dev/index.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { createDevApp } from '@backstage/dev-utils';
32
import { sysdigPlugin, SysdigPage } from '../src/plugin';
43
import { EntityProvider } from '@backstage/plugin-catalog-react';
@@ -16,12 +15,12 @@ const mockEntity = {
1615
// 'sysdigcloud.com/kubernetes-cluster-name': 'sock-shop-cluster',
1716
// 'sysdigcloud.com/kubernetes-namespace-name': 'sock-shop',
1817
// 'sysdigcloud.com/kubernetes-workload-name': 'sock-shop-carts',
19-
// 'sysdigcloud.com/kubernetes-workload-type': 'deployment',
20-
// 'sysdigcloud.com/registry-vendor': 'harbor',
18+
'sysdigcloud.com/kubernetes-workload-type': 'deployment',
19+
'sysdigcloud.com/registry-vendor': 'dockerv2',
2120
// 'sysdigcloud.com/registry-name': 'registry-harbor-registry.registry.svc.cluster.local:5443',
22-
// 'sysdigcloud.com/image-freetext': 'ghcr.io/sysdiglabs',
23-
// 'sysdigcloud.com/resource-name': 'sock-shop-carts',
24-
// 'sysdigcloud.com/resource-type': 'Deployment',
21+
'sysdigcloud.com/image-freetext': 'ghcr.io',
22+
'sysdigcloud.com/resource-name': 'sock-shop-carts',
23+
'sysdigcloud.com/resource-type': 'Deployment',
2524
},
2625
},
2726
spec: {

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sysdig/backstage-plugin-sysdig",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"main": "dist/index.esm.js",
55
"types": "dist/index.d.ts",
66
"license": "Apache-2.0",
@@ -28,9 +28,9 @@
2828
"@testing-library/react": "^16.0.0"
2929
},
3030
"dependencies": {
31-
"@backstage/core-components": "^0.14.0",
32-
"@backstage/core-plugin-api": "^1.9.0",
33-
"@backstage/plugin-catalog-react": "^1.13.0",
31+
"@backstage/core-components": "^0.18.3",
32+
"@backstage/core-plugin-api": "^1.12.0",
33+
"@backstage/plugin-catalog-react": "^1.21.3",
3434
"@mui/icons-material": "^5.16.0",
3535
"@mui/material": "^5.16.0",
3636
"react-use": "^17.2.4"
@@ -40,11 +40,11 @@
4040
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0"
4141
},
4242
"devDependencies": {
43-
"@backstage/cli": "^0.25.2",
43+
"@backstage/cli": "^0.34.5",
4444
"@backstage/config": "^1.3.6",
45-
"@backstage/dev-utils": "^1.0.27",
45+
"@backstage/dev-utils": "^1.1.17",
4646
"@backstage/eslint-plugin": "^0.2.0",
47-
"@backstage/test-utils": "^1.5.0",
47+
"@backstage/test-utils": "^1.7.13",
4848
"@emotion/react": "^11.14.0",
4949
"@emotion/styled": "^11.14.1",
5050
"@spotify/eslint-config-base": "^15.0.0",

src/components/SysdigComponent/SysdigComponent.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import React from 'react';
1716
import { SysdigComponent } from './SysdigComponent';
1817
import { rest } from 'msw';
1918
import { setupServer } from 'msw/node';

src/components/SysdigComponent/SysdigComponent.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import React from 'react';
1716
import Grid from '@mui/material/Grid';
1817
import {
1918
Header,

src/components/SysdigPostureFetchComponent/SysdigPostureFetchComponent.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import React from 'react';
1716
import { screen } from '@testing-library/react';
1817
import { SysdigPostureFetchComponent } from './SysdigPostureFetchComponent';
1918
import { EntityProvider } from '@backstage/plugin-catalog-react';

src/components/SysdigPostureFetchComponent/SysdigPostureFetchComponent.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import React from 'react';
16+
import { useMemo } from 'react';
1717
import { Table, TableColumn, Progress } from '@backstage/core-components';
1818
import useAsync from 'react-use/lib/useAsync';
1919
import Alert from '@mui/material/Alert';
@@ -114,7 +114,7 @@ type PostureScan = {
114114

115115
type DenseTableProps = {
116116
postureScans: PostureScan[];
117-
title: React.JSX.Element;
117+
title: JSX.Element;
118118
};
119119

120120
// Example image response from Sysdig scanning API
@@ -216,7 +216,7 @@ export const SysdigPostureFetchComponent = () => {
216216

217217
const annotations = entity.metadata.annotations;
218218

219-
const { filter, backlink, hasSysdigAnnotations } = React.useMemo(() => {
219+
const { filter, backlink, hasSysdigAnnotations } = useMemo(() => {
220220
let currentFilter = '?filter=';
221221
let currentBacklink = getBacklink(endpoint, backlink_config, "inventory");
222222
let name: string | undefined;

0 commit comments

Comments
 (0)