Skip to content

Commit

Permalink
Fix tests and add GitHub Actions for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mraible committed Sep 25, 2024
1 parent 1d4cbc3 commit e5c5360
Show file tree
Hide file tree
Showing 7 changed files with 6,509 additions and 4,193 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Sample CI
on: [ push, pull_request ]

jobs:
build:
strategy:
matrix:
path:
- ui/extensions/remediations
- up/pages/chart-vue
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Run yarn install in ${{ matrix.path }}
uses: borales/actions-yarn@v5
with:
cmd: install
dir: ${{ matrix.path }}
- name: Build Vue app in ${{ matrix.path }}
uses: borales/actions-yarn@v5
with:
cmd: build
dir: ${{ matrix.path }}
- name: Test the Vue app in ${{ matrix.path }}
uses: borales/actions-yarn@v5
with:
cmd: test:unit
dir: ${{ matrix.path }}
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea
node_modules
.idea
.idea/
node_modules/
.DS_Store
.vscode
yarn-error.log
yarn-error.log
.yarnrc.yml
.yarn/
4 changes: 2 additions & 2 deletions shared/mitre-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
},
"dependencies": {
"@crowdstrike/foundry-js": "0.10.0",
"@intlify/unplugin-vue-i18n": "^1.2.0",
"@shoelace-style/shoelace": "^2.8.0",
"pinia": "^2.1.3",
"vue": "^3.3.4",
"vue-i18n": "^9.3.0-beta.14-77e850b",
"@intlify/unplugin-vue-i18n": "^1.2.0"
"vue-i18n": "^9.3.0-beta.14-77e850b"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.2.0",
Expand Down
9 changes: 4 additions & 5 deletions shared/mitre-vue/tests/utils/transformData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ describe('Unit test - transformData.ts', () => {
false,
false
)



result.map((tactic) => {
const listOfTechniques = tactic.techniques.map(t => t.technique_id);

Expand Down Expand Up @@ -124,7 +123,7 @@ describe('Unit test - transformData.ts', () => {
const from = new Date();
from.setDate(to.getDate() - 91)
const calculatedTrend = calculateTrend(exampleTrendData as TrendAggregate, from, to)
expect(calculatedTrend).toBe(1)
expect(calculatedTrend).toBe(-1)
})

it('Should calculate trend a 100% decrease', () => {
Expand Down Expand Up @@ -215,9 +214,9 @@ describe('Unit test - transformData.ts', () => {

expect(foundSubTechnique?.is_subtechnique).toBeTruthy()


const severityDetails = Object.values(foundSubTechnique?.severity_details)

technique?.sub_aggregates?.find(t => t.name === 'Severity')?.buckets.map((severity) =>{
expect(severityDetails.includes(severity.count)).toBeTruthy()
})
Expand Down
6 changes: 3 additions & 3 deletions ui/extensions/remediations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"dependencies": {
"@crowdstrike/foundry-js": "0.10.0",
"@intlify/unplugin-vue-i18n": "^0.12.3",
"@mitre/vue-shared": "*",
"@shoelace-style/shoelace": "^2.8.0",
"pinia": "^2.1.3",
"vue": "^3.3.4",
"vue-i18n": "^9.3.0-beta.14-77e850b",
"@mitre/vue-shared": "*"
"vue-i18n": "^9.3.0-beta.14-77e850b"
},
"devDependencies": {
"@modyfi/vite-plugin-yaml": "^1.0.4",
Expand Down Expand Up @@ -54,5 +54,5 @@
},
"engines": {
"node": ">=18.12.0"
}
}
}
4 changes: 2 additions & 2 deletions ui/pages/chart-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"dependencies": {
"@crowdstrike/foundry-js": "0.10.0",
"@intlify/unplugin-vue-i18n": "^0.12.3",
"@mitre/vue-shared": "*",
"@shoelace-style/shoelace": "^2.8.0",
"pinia": "^2.1.3",
"vue": "^3.3.4",
"vue-i18n": "^9.3.0-beta.14-77e850b",
"vue-router": "^4.2.2",
"@mitre/vue-shared": "*"
"vue-router": "^4.2.2"
},
"devDependencies": {
"@modyfi/vite-plugin-yaml": "^1.0.4",
Expand Down
Loading

0 comments on commit e5c5360

Please sign in to comment.