Merge sort #214
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | |
name: CI/CD | |
on: [push, pull_request] | |
permissions: | |
contents: read | |
jobs: | |
api-build: | |
runs-on: ubuntu-latest | |
env: | |
working-directory: ./api | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
working-directory: ${{env.working-directory }} | |
- name: Build with Gradle | |
run: ./gradlew clean build | |
working-directory: ${{env.working-directory }} | |
api-test: | |
runs-on: ubuntu-latest | |
env: | |
working-directory: ./api | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Test with Gradle | |
run: ./gradlew test | |
working-directory: ${{env.working-directory }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tests | |
path: ./api/build/reports/tests/ | |
api-checkstyle: | |
runs-on: ubuntu-latest | |
env: | |
working-directory: ./api | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
working-directory: ${{env.working-directory }} | |
- name: Checkstyle Main | |
run: ./gradlew checkstyleMain | |
working-directory: ${{env.working-directory }} | |
- name: Checkstyle Test | |
if: always() | |
run: ./gradlew checkstyleTest | |
working-directory: ${{env.working-directory }} | |
- name: Upload artifact | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: checkstyle | |
path: ./api/build/reports/checkstyle/ | |
api-spotbugs: | |
runs-on: ubuntu-latest | |
env: | |
working-directory: ./api | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
working-directory: ${{env.working-directory }} | |
- name: Spotbugs Main | |
run: ./gradlew spotbugsMain | |
working-directory: ${{env.working-directory }} | |
- name: Spotbugs Test | |
if: always() | |
run: ./gradlew spotbugsTest | |
working-directory: ${{env.working-directory }} | |
- name: Upload artifact | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: spotbugs | |
path: ./api/build/reports/spotbugs/ | |
frontend-build: | |
runs-on: ubuntu-latest | |
env: | |
working-directory: ./Frontend/algoverse | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '14' | |
- name: Install dependencies | |
run: | | |
npm install | |
working-directory: ${{env.working-directory }} | |
- name: build | |
run: | | |
CI=false npm run build | |
working-directory: ${{env.working-directory }} | |
- name: test | |
run: | | |
npm test | |
working-directory: ${{env.working-directory }} | |