diff --git a/.github/workflows/pr-builder.yml b/.github/workflows/pr-builder.yml index f9b7834d332..120ec2cbe32 100644 --- a/.github/workflows/pr-builder.yml +++ b/.github/workflows/pr-builder.yml @@ -21,7 +21,8 @@ env: jobs: lint: name: ⬣ ESLint (STATIC ANALYSIS) - if: ${{ github.event_name == 'pull_request' || github.event.label.name == 'trigger-pr-builder' }} + # if: ${{ github.event_name == 'pull_request' || github.event.label.name == 'trigger-pr-builder' }} + if: ${{ false }} runs-on: ubuntu-latest strategy: matrix: @@ -84,7 +85,8 @@ jobs: typecheck: name: ʦ Typecheck (STATIC ANALYSIS) - if: ${{ github.event.label.name == 'trigger-pr-builder' || github.event_name == 'pull_request'}} + # if: ${{ github.event.label.name == 'trigger-pr-builder' || github.event_name == 'pull_request'}} + if: ${{ false }} runs-on: ubuntu-latest strategy: matrix: @@ -142,6 +144,7 @@ jobs: test: name: 👾 Unit Test (TESTING) + if: ${{ false }} needs: [ typecheck ] runs-on: ubuntu-latest strategy: @@ -227,7 +230,6 @@ jobs: build: name: 🚧 Build - needs: [ test, typecheck ] runs-on: ubuntu-latest strategy: matrix: @@ -237,8 +239,10 @@ jobs: pnpm-version: [ 8.7.4 ] steps: - name: ⬇️ Checkout - id: checkout - uses: actions/checkout@v2.3.3 + id: checkout-master + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: 🟢 Setup node id: setup-node @@ -246,6 +250,12 @@ jobs: with: node-version: ${{ matrix.node-version }} + - name: 🐳 Set SHAs for Nx + id: set-shas + uses: nrwl/nx-set-shas@v3 + with: + main-branch-name: "master" + - name: ☕ Set up JDK 11 id: jdk-setup uses: actions/setup-java@v3 @@ -286,13 +296,7 @@ jobs: - name: 👷 PNPM Build id: build-with-pnpm - run: pnpm build - - - name: 🏗️ Maven Build identity-apps-core - id: build-with-maven - run: | - cd identity-apps-core - mvn clean install -U -Dlint.exec.skip=true -Dbootstrap.exec.skip=true + run: pnpm nx affected --base=origin/master --head=${{ env.NX_HEAD }} --target=build --parallel=3 - name: 💾 Cache local Maven repository id: cache-maven-m2 diff --git a/identity-apps-core/package.json b/identity-apps-core/package.json index d6121dfb093..11f2c740299 100644 --- a/identity-apps-core/package.json +++ b/identity-apps-core/package.json @@ -6,11 +6,12 @@ "author": "WSO2", "license": "Apache-2.0", "scripts": { - "build": "pnpm nx run theme:build && node theme-distribute.js", - "clean": "pnpm clean:lock-files && pnpm clean:maven-folders && pnpm clean:node-modules", - "clean:lock-files": "pnpm rimraf package-lock.json && pnpm rimraf pnpm-lock.yaml && pnpm rimraf yarn.lock", - "clean:maven-folders": "pnpm rimraf target", - "clean:node-modules": "pnpm rimraf node_modules" + "build": "mvn clean install", + "build:theme": "pnpm nx run theme:build && node theme-distribute.js", + "clean": "pnpm clean:theme-folders && pnpm clean:node-modules && pnpm clean:maven-folders", + "clean:maven-folders": "mvn clean", + "clean:node-modules": "pnpm rimraf node_modules", + "clean:theme-folders": "node theme-distribute.js clean" }, "dependencies": { "@wso2is/theme": "^2.1.4", diff --git a/identity-apps-core/pom.xml b/identity-apps-core/pom.xml index 32f88432dcb..46b34193455 100644 --- a/identity-apps-core/pom.xml +++ b/identity-apps-core/pom.xml @@ -581,7 +581,7 @@ - + org.codehaus.mojo 1.6.0 @@ -603,21 +603,7 @@ ${basedir} - - run-linter - - exec - - process-resources - - pnpm - - lint - - ${lint.exec.skip} - ${basedir} - - + npm run build (compile) @@ -627,7 +613,7 @@ pnpm - build + build:theme ${basedir} diff --git a/identity-apps-core/theme-distribute.js b/identity-apps-core/theme-distribute.js index a09d3ad43ae..100bbd536d0 100644 --- a/identity-apps-core/theme-distribute.js +++ b/identity-apps-core/theme-distribute.js @@ -15,6 +15,7 @@ * specific language governing permissions and limitations * under the License. */ +/* eslint-disable no-console */ const path = require("path"); const fs = require("fs-extra"); @@ -25,6 +26,7 @@ const apps = [ "authentication-portal", "recovery-portal", "x509-certificate-aut async function deleteExistingThemesFolder() { for (const app of apps) { const themePath = path.join(__dirname, "apps", app, "src", "main", "webapp", "libs", "themes"); + if (fs.existsSync(themePath)) { console.log(`Deleting existing themes folder in ${app} app...`); await fs.remove(themePath); @@ -50,4 +52,12 @@ async function main() { } } -main(); +// Parse command-line arguments. +const args = process.argv.slice(2); + +// Check which function to run based on the arguments. +if (args.includes("clean")) { + deleteExistingThemesFolder().catch(console.error); +} else { + main().catch(console.error); +}