From 3ea0c53df25e04485b8af0edc2ce95874a998022 Mon Sep 17 00:00:00 2001 From: Julie Muzina Date: Wed, 31 Jul 2024 22:43:05 -0400 Subject: [PATCH] Run tests on PRs; lint before deployment (#20) --- .github/workflows/ci.yml | 3 +++ .github/workflows/pr.yml | 25 +++++++++++++++++++++++++ package.json | 3 ++- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 010d692..aaf3718 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,9 @@ jobs: - name: Install Angular dependencies run: npm ci + - name: Lint + run: npm run lint + - name: Build Angular run: npm run build:${{ inputs.environment }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..224947d --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,25 @@ +name: PR Tests + +on: + pull_request: + branches: + - main + - dev + +jobs: + build: + name: Build + runs-on: ubuntu-latest + environment: ${{ inputs.environment }} + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + + - name: Install Angular dependencies + run: npm ci + + - name: Lint + run: npm run lint + + - name: Build Angular + run: npm run build:dev && rm -rf dist && npm run build:prod diff --git a/package.json b/package.json index 1ccc125..3fb6057 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,12 @@ "ng": "ng", "start": "ng serve", "build": "ng build", - "build:dev": "ng build --configuration development", + "build:dev": "npx ng build --configuration development", "build:prod": "npx ng build --configuration production", "watch": "ng build --watch --configuration development", "test": "ng test", "lint": "ng lint", + "clean": "rm -rf dist node_modules", "sentry:sourcemaps": "sentry-cli sourcemaps inject --org julie-muzina-a008ebe1f --project jmuzina-portfolio ./dist && sentry-cli sourcemaps upload --org julie-muzina-a008ebe1f --project jmuzina-portfolio ./dist" }, "private": true,