From 12555167a091438a60399d56ff4d7ec244ef4f36 Mon Sep 17 00:00:00 2001 From: Tim Velasquez <59290068+MrAwesome2127@users.noreply.github.com> Date: Thu, 27 Feb 2025 19:50:01 -0600 Subject: [PATCH 1/5] Create main.yml --- .github/workflows/main.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..d12a5f6a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +# Name of workflow +name: Lint workflow + +# Trigger workflow on all pull requests +on: + pull_request: + branches: + - develop + - staging + +# Jobs to carry out +jobs: + test: + # Operating system to run job on + runs-on: ubuntu-latest + + # Steps in job + steps: + # Get code from repo + - name: Checkout code + uses: actions/checkout@v1 + + - name: Use Node.js 21.x + uses: actions/setup-node@v1 + with: + node-version: 21.x + + # Install dependencies + - name: 🧰 Install Deps + run: npm install + + # Run lint + - name: Run Lint + run: npm run lint From da3fd359709c9450fe92b0ae5a4136f94668bd3c Mon Sep 17 00:00:00 2001 From: Tim Velasquez Date: Thu, 27 Feb 2025 20:33:17 -0600 Subject: [PATCH 2/5] added to test to my yaml daml --- .github/workflows/main.yml | 11 ++++++++++- src/components/Advertisement.tsx | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d12a5f6a..99d2622d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,5 @@ # Name of workflow -name: Lint workflow +name: Lint and Test workflow # Trigger workflow on all pull requests on: @@ -32,3 +32,12 @@ jobs: # Run lint - name: Run Lint run: npm run lint + + # Run build + - name: Run Build + run: npm run build + + # Run tests + - name: Run Tests + run: npm run test + \ No newline at end of file diff --git a/src/components/Advertisement.tsx b/src/components/Advertisement.tsx index 2181f6aa..bb55bcb2 100644 --- a/src/components/Advertisement.tsx +++ b/src/components/Advertisement.tsx @@ -2,7 +2,7 @@ interface AdvertisementProps { companyName: string; productDescription: string; price: string; -}; +} function Advertisement(props: AdvertisementProps) { return ( From db909db121eb6e0adf9727312d793da7e4eed655 Mon Sep 17 00:00:00 2001 From: Tim Velasquez Date: Thu, 27 Feb 2025 20:44:09 -0600 Subject: [PATCH 3/5] updated yaml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 99d2622d..a4ff575a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,6 +7,7 @@ on: branches: - develop - staging + - main # Jobs to carry out jobs: From f11fe5c5cabd3617cce42216d5ac8ec44df2a3f0 Mon Sep 17 00:00:00 2001 From: Tim Velasquez Date: Thu, 27 Feb 2025 20:58:37 -0600 Subject: [PATCH 4/5] added deploy to the code --- .github/workflows/deploy.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..48fbab38 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,27 @@ +name: Deploy + +on: + push: + branches: [main] + pull_request: + branches: + - main + +jobs: + ci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Test + run: | + npm install + npm run test + + - name: Deploy + if: github.ref == 'refs/heads/main' + env: + DEPLOY_URL: ${{ secrets.RENDER_DEPLOY_HOOK_URL }} + run: | + curl "$DEPLOY_URL" + \ No newline at end of file From cc3a873fcbe47204a5b2cc80a2b418d45e90e8d7 Mon Sep 17 00:00:00 2001 From: Tim Velasquez Date: Thu, 27 Feb 2025 21:06:21 -0600 Subject: [PATCH 5/5] updated the test --- src/components/Calculator.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Calculator.tsx b/src/components/Calculator.tsx index bfac7800..9040d335 100644 --- a/src/components/Calculator.tsx +++ b/src/components/Calculator.tsx @@ -15,6 +15,7 @@ export default function Calculator() { return (
+

Simple Calculator