From ccc3cf16cbf0ab3d582b81fa2e8df7c695cc496a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Bokvad=20Engar=C3=A5s?= Date: Fri, 29 Sep 2023 13:41:16 +0200 Subject: [PATCH 1/2] refactor project --- .github/workflows/build.yml | 28 ---------------------------- .github/workflows/test.yml | 20 +++++++++++++++----- 2 files changed, 15 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 7fe401a9..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Build -run-name: ${{ github.actor }} is testing out github actions -permissions: - contents: read - pages: read - id-token: write - -on: [push, workflow_dispatch] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup node - uses: actions/setup-node@v3 - - name: Install dependencies - run: npm ci - - name: debug root - run: ls - - name: debug subfolder - run: cd src && ls - - name: Build - run: npm run build - - name: 'Run Compliance State' - uses: ./ - with: - cydigConfigPath: ${{ github.workspace }}/src/cydigconfig.json - PAT-token: ${{ secrets.MY_GITHUB_PAT}} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 61edfab3..559b572d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,16 +1,26 @@ -name: Test +name: test action run-name: ${{ github.actor }} is running tests +permissions: + contents: read + pages: read + id-token: write -on: [push] +on: [push, workflow_dispatch] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Setup node uses: actions/setup-node@v3 - - name: Install + - name: Install dependencies run: npm ci - - name: Build tests + - name: Build and run tests run: npm run buildTests + - name: Build Action + run: npm run build + - name: 'Run Compliance State Action' + uses: ./ + with: + cydigConfigPath: ${{ github.workspace }}/src/cydigconfig.json + PAT-token: ${{ secrets.MY_GITHUB_PAT}} \ No newline at end of file From e8fa68c37c13b4157e4d389b01d9cb5acabdc5f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Bokvad=20Engar=C3=A5s?= Date: Fri, 29 Sep 2023 13:43:44 +0200 Subject: [PATCH 2/2] refactor project --- .github/workflows/test.yml | 2 +- package.json | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 559b572d..90398a10 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: - name: Install dependencies run: npm ci - name: Build and run tests - run: npm run buildTests + run: npm run test - name: Build Action run: npm run build - name: 'Run Compliance State Action' diff --git a/package.json b/package.json index 28c16083..034942d4 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,8 @@ "main": "dist/index.js", "scripts": { "build": "ncc build src/index.ts", - "buildTests": "tsc", - "test": "npm run buildTests && mocha dist/tests/", - "testScript": "npm run buildTests && mocha dist/tests/ --reporter xunit --reporter-option output=ResultsFile.xml", + "test": "tsc && mocha dist/tests/", + "testScript": "tsc && mocha dist/tests/ --reporter xunit --reporter-option output=ResultsFile.xml", "prepare": "husky install", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --fix --ext .ts",