From e9e7835b00d783ac28e48572a90044c1d332b8ec Mon Sep 17 00:00:00 2001 From: nrusso Date: Sun, 10 Dec 2023 14:33:23 -0300 Subject: [PATCH] ci: remove dagger and and lint and type check --- .github/workflows/test.yml | 25 +++++++++++++++---- dagger.mjs | 50 -------------------------------------- deployment.yml | 19 --------------- package.json | 3 +-- pnpm-lock.yaml | 8 +++--- 5 files changed, 25 insertions(+), 80 deletions(-) delete mode 100644 dagger.mjs delete mode 100644 deployment.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b767f2e8..accbbdba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,11 +33,26 @@ jobs: - name: Install Dependencies with PNPM run: pnpm install - - name: Install Dagger CLI - run: cd /usr/local && { curl -L https://dl.dagger.io/dagger/install.sh | sh; cd -; } + - name: Build + run: pnpm build - - name: Release and deploy with Dagger + - name: Type Check + run: pnpm ts-check + + - name: Lint Check + run: pnpm lint + + - name: Test + run: pnpm test + + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: SonarQube Quality Check + uses: sonarsource/sonarqube-quality-gate-action@master + timeout-minutes: 5 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - run: dagger run node dagger.mjs diff --git a/dagger.mjs b/dagger.mjs deleted file mode 100644 index e69bf028..00000000 --- a/dagger.mjs +++ /dev/null @@ -1,50 +0,0 @@ -import { connect } from "@dagger.io/dagger" - -connect(async (client) => -{ - // Get Node image - const containerNode = await client.container().from("node:18-bullseye"); - - // Get reference to the local project - const source = await client - .host() - .directory(".", { - exclude: [ - "node_modules/", - "infrastructure", - ".github", - "docs" - ] - }); - - const nodeCache = client.cacheVolume("node"); - - // Mount cloned repository into Node image - const runner = containerNode - .withDirectory("/home/node/app", source) - .withWorkdir("/home/node/app") - .withMountedCache("/home/node/app/node_modules", nodeCache); - - // Install pnpm package manager and packages - const install = runner - .withExec(["npm", "install", "-g", "pnpm", "sonarqube-scanner"]) - .withExec(["pnpm", "install"]); - - // Build and Test - const test = install - .withExec(["pnpm", "build"]) - .withEnvVariable("NODE_ENV", "test") - .withExec(["pnpm", "test"]); - - // Sonarcloud scanner - const sonarCloud = await test - .withEnvVariable("SONAR_TOKEN", process.env.SONAR_TOKEN) - .withEnvVariable("GITHUB_TOKEN", process.env.GITHUB_TOKEN) - .withExec(["sonar-scanner"]) - .directory("coverage/") - .export("./coverage"); - - console.log(sonarCloud); - console.log("Successfully"); - -}, { LogOutput: process.stdout }) diff --git a/deployment.yml b/deployment.yml deleted file mode 100644 index 521c6246..00000000 --- a/deployment.yml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: experience-node -spec: - replicas: 2 - selector: - matchLabels: - app: experience-node - template: - metadata: - labels: - app: experience-node - spec: - containers: - - name: node - image: node-experience-node:latest - ports: - - containerPort: 8089 diff --git a/package.json b/package.json index 1d9da108..a074b530 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,6 @@ "version": "2.1.12", "description": "", "scripts": { - "dagger": "dagger run node dagger.mjs", "build": "node rimraf_cpy.mjs && tsc -p tsconfig.json --incremental", "ci": "npm run cpy-ci && npm run ts-check && npm run lint", "circular": "madge --circular dist/src/index.js", @@ -84,7 +83,7 @@ "devDependencies": { "@commitlint/cli": "^18.4.3", "@commitlint/config-conventional": "^18.4.3", - "@dagger.io/dagger": "^0.9.4", + "@dagger.io/dagger": "0.9.3", "@shelf/jest-mongodb": "^4.2.0", "@types/bcrypt": "^5.0.1", "@types/config": "^0.0.41", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbad698f..4d6ae712 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -158,8 +158,8 @@ devDependencies: specifier: ^18.4.3 version: 18.4.3 '@dagger.io/dagger': - specifier: ^0.9.4 - version: 0.9.4 + specifier: 0.9.3 + version: 0.9.3 '@shelf/jest-mongodb': specifier: ^4.2.0 version: 4.2.0(jest-environment-node@29.7.0)(mongodb@6.3.0) @@ -796,8 +796,8 @@ packages: '@jridgewell/trace-mapping': 0.3.9 dev: true - /@dagger.io/dagger@0.9.4: - resolution: {integrity: sha512-b4BXg8RzaDGGb6qcottHo3/4T3uaC78OPEQwNQavezkiEHS3lztA3L/ds65/SmvUNqju9kH/3ben7lwJfEpRtQ==} + /@dagger.io/dagger@0.9.3: + resolution: {integrity: sha512-kEZ6yWfCLAPcqUB8oQ9qAR7NfWAl16ubj3gYprJGqUfA6s9WN/tG9GPZ7smxFP4tVvRIoyuMnYnOA3f2ypmrIQ==} engines: {node: '>=16'} dependencies: '@lifeomic/axios-fetch': 3.0.1