From 8bac4a819c06225e98f1e930db2f3ac806162577 Mon Sep 17 00:00:00 2001 From: daz Date: Wed, 10 Apr 2024 06:01:23 -0600 Subject: [PATCH] Split out check-and-unit-test into separate workflow --- .github/workflows/ci-check-and-unit-test.yml | 30 ++++++++++++++++++++ .github/workflows/ci-quick-check.yml | 15 ---------- sources/package.json | 9 +++--- 3 files changed, 35 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/ci-check-and-unit-test.yml diff --git a/.github/workflows/ci-check-and-unit-test.yml b/.github/workflows/ci-check-and-unit-test.yml new file mode 100644 index 0000000..96a7def --- /dev/null +++ b/.github/workflows/ci-check-and-unit-test.yml @@ -0,0 +1,30 @@ +name: CI-check-and-unit-test + +on: + push: + +permissions: + contents: read + +jobs: + check-format-and-unit-test: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: sources/package-lock.json + + - name: Check formatting and compile + run: | + npm install + npm run check + npm run compile + working-directory: sources + - name: Run unit tests + run: | + npm test + working-directory: sources diff --git a/.github/workflows/ci-quick-check.yml b/.github/workflows/ci-quick-check.yml index d458466..aa1410f 100644 --- a/.github/workflows/ci-quick-check.yml +++ b/.github/workflows/ci-quick-check.yml @@ -16,21 +16,6 @@ jobs: - name: Build and upload distribution uses: ./.github/actions/build-dist - run-unit-tests: - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - name: Configure Gradle as default for unit test - uses: ./setup-gradle - with: - gradle-version: 8.7 - - name: Run tests - run: | - npm install - npm run all - working-directory: sources - action-inputs: needs: build-distribution uses: ./.github/workflows/integ-test-action-inputs.yml diff --git a/sources/package.json b/sources/package.json index e366242..6c3b53a 100644 --- a/sources/package.json +++ b/sources/package.json @@ -5,17 +5,18 @@ "description": "Execute Gradle Build", "scripts": { "postinstall": "patch-package", - "format": "prettier --write 'src/**/*.ts'", - "format-check": "prettier --check 'src/**/*.ts'", + "prettier-write": "prettier --write 'src/**/*.ts'", + "prettier-check": "prettier --check 'src/**/*.ts'", "lint": "eslint 'src/**/*.ts'", "compile-dependency-submission-main": "ncc build src/dependency-submission/main.ts --out ../dist/dependency-submission/main --source-map --no-source-map-register", "compile-dependency-submission-post": "ncc build src/dependency-submission/post.ts --out ../dist/dependency-submission/post --source-map --no-source-map-register", "compile-setup-gradle-main": "ncc build src/setup-gradle/main.ts --out ../dist/setup-gradle/main --source-map --no-source-map-register", "compile-setup-gradle-post": "ncc build src/setup-gradle/post.ts --out ../dist/setup-gradle/post --source-map --no-source-map-register", "compile": "npm-run-all --parallel compile-*", - "check": "npm-run-all --parallel format lint", + "check": "npm-run-all --parallel prettier-check lint", + "format": "npm-run-all --parallel prettier-write lint", "test": "jest", - "build": "npm run check && npm run compile", + "build": "npm run format && npm run compile", "all": "npm run build && npm test" }, "repository": {