diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..5dcce4dac --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,37 @@ +name: Java CI with Maven + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Cache Maven packages + uses: actions/cache@v3 + with: + path: ~/.m2 + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Build with Maven + run: mvn -B clean install + + - name: Run tests + run: mvn test + +#comment: This workflow is triggered on pushes and pull requests to the main branch. It checks out the code, sets up JDK 17, caches Maven dependencies, builds the project, and runs tests. \ No newline at end of file diff --git a/README.md b/README.md index 531c6f802..d5156f8cf 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,4 @@ Java (Maven) application for tracking time on the job Time tracker -Good Night Students!!! +Good Morning Students!!! diff --git a/workflow/deployment.yaml b/workflow/deployment.yaml new file mode 100644 index 000000000..b38b428df --- /dev/null +++ b/workflow/deployment.yaml @@ -0,0 +1,35 @@ +name: Java CI with Maven + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Cache Maven packages + uses: actions/cache@v3 + with: + path: ~/.m2 + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Build with Maven + run: mvn -B clean install + + - name: Run tests + run: mvn test \ No newline at end of file