-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Finalize CI/CD Pipeline #2897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Finalize CI/CD Pipeline #2897
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
863a141
feat: Create initial CI pipeline with build job
b6fc45e
chore: Update workflow name to trigger re-read
b328eb9
fix: Simplify workflow trigger to debug parsing issue
ce2ae17
Configure unit test and coverage test with report
Agligoglio 30c5993
Initial empty commit
oo123code 626dc23
feature/build-automation: Modified build files to build project succe…
oo123code faf944d
Fixed formatiing issues at gson/pom.xml (root directory)
oo123code 5c0a31a
Merge pull request #1 from oo123code/feature/build-automation
24-Kwek-44 35c02ca
Merge branch 'main' into feature/ci-pipeline
c688282
ci: Add step to upload build artifact
b6b99f1
fix: Update upload-artifact action to v4
076c485
Merge pull request #2 from HONGJIE-666/feature-Loi_Unit-Testing
24-Kwek-44 2737aa8
Merge branch 'main' into feature/ci-pipeline
f78b46c
ci: Add test job to pipeline
f3b380a
fix: Use 'mvn install' to resolve JPMS module issue in test job
92de21d
fix: Use 'mvn verify' to satisfy Spotless check and run tests
e059c3e
style: Apply Spotless formatting to fix CI build
876f653
Add Dockerfile for deployment automation
TJ9659 2e91f02
Merge pull request #3 from 24-Kwek-44/feature/deployment-docker
24-Kwek-44 27aab29
style: Apply Spotless formatting to CI file
8f3f8a2
Merge branch 'main' into feature/ci-pipeline
93152eb
ci: Add deploy job to build Docker image
b6b2a27
style: Apply Spotless formatting after adding deploy job
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| name: UECS2s363 Assignment CI Pipeline v2 | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository code | ||
| uses: actions/checkout@v3 | ||
| - name: Set up JDK 11 | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: '11' | ||
| distribution: 'temurin' | ||
| - name: Build project with Maven | ||
| run: mvn -B verify --file pom.xml | ||
| - name: Upload build artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: gson-jar | ||
| path: gson/target/gson-*.jar | ||
|
|
||
| test: | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository code | ||
| uses: actions/checkout@v3 | ||
| - name: Set up JDK 11 | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: '11' | ||
| distribution: 'temurin' | ||
| - name: Run unit tests with Maven | ||
| run: mvn -B verify | ||
| - name: Upload test reports | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: test-reports | ||
| path: gson/target/surefire-reports/ | ||
|
|
||
| deploy: | ||
|
Comment on lines
+25
to
+43
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: gson-jar | ||
| path: gson/target/ | ||
|
|
||
| - name: Build Docker image | ||
| run: docker build -t gson-app . | ||
|
Comment on lines
+44
to
+57
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "java.compile.nullAnalysis.mode": "automatic", | ||
| "java.configuration.updateBuildConfiguration": "interactive" | ||
| } |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| FROM openjdk:17-jdk-slim | ||
|
|
||
| # Set the working directory inside the container | ||
| WORKDIR /app | ||
|
|
||
| # Copy the entire project into the container | ||
| COPY . . | ||
|
|
||
| # Install Maven and update package index | ||
| RUN apt-get update && apt-get install -y maven | ||
|
|
||
| # Apply formatting fixes first | ||
| RUN mvn spotless:apply | ||
|
|
||
| # Build without tests | ||
| RUN mvn clean install -DskipTests | ||
|
|
||
| # Default command to indicate deployment automation completed successfully | ||
| # Note: Project has no executable main method, so this is just a placeholder | ||
| CMD ["echo", "Deployment automation demonstrated"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium