npedidos / rest-api

NPedidos es una aplicación que permite la gestión simple de pedidos de menús de comidas, por fechas.
MIT License
8 stars 16 forks source link

Configurar Github Action #3

Closed nmarulo closed 1 year ago

nmarulo commented 1 year ago

Crear la carpeta .github/workflows/ y el fichero maven.yml con la siguiente información:

name: Java CI with Maven

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
    - uses: actions/checkout@v3

    - name: Set up JDK 17
      uses: actions/setup-java@v3
      with:
        java-version: '17'
        distribution: 'temurin'
        cache: 'maven'

    - name: Compile with Maven
      run: mvn -B compile --file pom.xml

    - name: Test
      run: mvn -B test --file pom.xml

Además, agregar la configuración de deepsource para que se suba el reporte de cobertura de los test.

chinmaym07 commented 1 year ago

Hello @nmarulo . Can I work on this ? Please do let me know about the second step. Do I need to create different .yml file for it or use the same maven.yml ? I didn't get the second step here https://deepsource.io/docs/analyzer/test-coverage/#with-github-actions-3

nmarulo commented 1 year ago

Hello @chinmaym07 Yes, of course.

Now, about your question, there is no new file to create, it would be on the same maven.yml file. And about the url (https://deepsource.io/docs/analyzer/test-coverage/#with-github-actions-3), there are 3 steps, but steps 1 and 2 are already done, you only need to configure step 3 to maven.yml but for this you need the library that generates the report, for example jacoco which is mentioned in the above url https://deepsource.io/docs/analyzer/test-coverage/#java.