From d12560d3bf30932edc273bb71ad0135ab1d7c48c Mon Sep 17 00:00:00 2001 From: Jimmykotter Date: Tue, 8 Apr 2025 18:34:11 -0500 Subject: [PATCH 1/2] added yml --- .github/workflows/main.yml | 34 ++++++++++++++++++++++++++++++++ src/components/Advertisement.tsx | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) 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..08cd36cd --- /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 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 7cc05378583492c4227c6dcdf74e446dc86a23f4 Mon Sep 17 00:00:00 2001 From: Jimmykotter Date: Tue, 8 Apr 2025 18:46:38 -0500 Subject: [PATCH 2/2] update test --- .github/workflows/main.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 08cd36cd..408540b5 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,11 @@ 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