diff --git a/.github/workflows/CI_backend.yml b/.github/workflows/CI_backend.yml new file mode 100644 index 0000000..daa604d --- /dev/null +++ b/.github/workflows/CI_backend.yml @@ -0,0 +1,41 @@ + +name: "Java Backend CI" + +# events +on: + push: + branches:["main","develop"] + # paths + paths: + - 'backend/**' + pull_request: + branches:["main","develop"] + # paths + paths: + - 'backend/**' + +env: + java_version: 17 +defaults: + run: + working-directory: ./backend + +jobs: + build: #first job + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 #action + + - name: Use java ${{env.java_version}} + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + + - name: Build with Gradle + run: ./gradlew + diff --git a/.github/workflows/CI_frontend.yml b/.github/workflows/CI_frontend.yml new file mode 100644 index 0000000..ac43245 --- /dev/null +++ b/.github/workflows/CI_frontend.yml @@ -0,0 +1,62 @@ +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 + uses: 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 npm clean install + uses: npm ci + + - run: npm test + + + + diff --git a/frontend/README.md b/frontend/README.md index 58beeac..e1c9cea 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -68,3 +68,6 @@ 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) + + +test