From 23ba36e4a306c11e3a8cdeb748842fb2eb6f5076 Mon Sep 17 00:00:00 2001 From: lucero garcia Date: Wed, 8 Jan 2025 13:32:25 -0600 Subject: [PATCH 1/3] Add ci for frontend --- .github/workflows/CI_frontend.yml | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/CI_frontend.yml diff --git a/.github/workflows/CI_frontend.yml b/.github/workflows/CI_frontend.yml new file mode 100644 index 0000000..3f91885 --- /dev/null +++ b/.github/workflows/CI_frontend.yml @@ -0,0 +1,39 @@ +name: "React frontend CI" + +# events +on: + push: + branches: ["main","develop"] + # paths + paths: + - 'frontend/**' + pull_request: + branches: ["main","develop"] + # paths + paths: + - 'frontend/**' + +env: + node_version: 22.x +defaults: + run: + working-directory: ./frontend + +jobs: + build: #first job + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4.1.7 # action + + - name: Use Node.js ${{ env.node_version }} + uses: actions/setup-node@v4.0.3 + with: + node-version: ${{ env.node_version }} + cache: 'npm' + cache-dependency-path: './frontend/package-lock.json' + + - name: Run npm clean install + run: npm ci + + - run: npm run build --if-present From 9cdc7997533a5c37df3770c54cba9951e3bbf7d1 Mon Sep 17 00:00:00 2001 From: lucero garcia Date: Wed, 8 Jan 2025 13:33:50 -0600 Subject: [PATCH 2/3] Add change --- frontend/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/README.md b/frontend/README.md index 58beeac..e5a2820 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -68,3 +68,5 @@ This section has moved here: [https://facebook.github.io/create-react-app/docs/d ### `npm run build` fails to minify This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) + +testing \ No newline at end of file From 24ffd40700f2e2864baa5a72bd6e88373a137634 Mon Sep 17 00:00:00 2001 From: lucero garcia Date: Wed, 8 Jan 2025 13:37:53 -0600 Subject: [PATCH 3/3] Add test job --- .github/workflows/CI_frontend.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/CI_frontend.yml b/.github/workflows/CI_frontend.yml index 3f91885..5f83a63 100644 --- a/.github/workflows/CI_frontend.yml +++ b/.github/workflows/CI_frontend.yml @@ -37,3 +37,19 @@ jobs: run: npm ci - run: npm run build --if-present + + test: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4.1.7 # action + + - name: Use Node.js ${{ env.node_version }} + uses: actions/setup-node@v4.0.3 + with: + node-version: ${{ env.node_version }} + cache: 'npm' + cache-dependency-path: './frontend/package-lock.json' + - name: "Run test on frontend" + run: npm ci + - run: npm test \ No newline at end of file