Skip to content

Commit fc07dd5

Browse files
Prepare for initial release 🌟 πŸ₯‡ (#4)
* Initial Maven project commit * Changed repository and project in badges * Added test cases for new coding challenges and scenarios * Fixes to several failed test cases and implemented new problem challenges. Closes #1 * Maven build and code-coverage configuration with `JaCoCo` * Added default Maven GitHub Action workflow * Lint fixes for workflows/maven.yml * [no ci] Added ReversePolishNotation and StoneWall implementation and their test cases * Added more tests in MinimumBinaryFlips with some modifications * Added new GitHub Action workflow for dependency review, new coding challenge question created (partial) * Added Jenkins CI configuration and new GitHub Action workflow * Changes to GHA workflows [skip ci] * Added GHA for CodeQL [no ci] * Added Gradle build to generate reports and test suites for release * [no ci] Removed CodeQL and Maven GHAs; Added combined CI workflow * Added binary tree operations and its test cases [no ci] * Added new challenge questions asked on Amazon interview * maven: Added JVM and Maven extensions * feat(challenge): Added new problem statements and their unit tests with introduction of Instancio * feat(codesignal): Closes #3 for CountDistinctSlices * feat(codesignal): Removed EquiLeader implementation, closes #3 * ci(github): Reviewed and updated CI pipeline for GitHub Actions * ci(github): Re-configured GHA workflow for CI * bugfix(test-cases): Fixed all failing JUnit test cases
1 parent 2febe87 commit fc07dd5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3102
-60
lines changed

β€Ž.gitattributes

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+

β€Ž.github/workflows/ci.yml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Build and Release
10+
11+
on:
12+
push:
13+
branches: ['main']
14+
pull_request:
15+
branches: [ 'main' ]
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
packages: read
21+
statuses: write # To report GitHub Actions status checks
22+
actions: read # Needed for detection of GitHub Actions environment.
23+
id-token: write # Needed for provenance signing and ID.
24+
pull-requests: write
25+
26+
jobs:
27+
gradle-build:
28+
name: Build with Gradle
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout sources
32+
uses: actions/checkout@v4
33+
34+
- name: Setup Java
35+
uses: actions/setup-java@v4
36+
with:
37+
distribution: 'temurin'
38+
java-version: 21
39+
architecture: x64
40+
41+
- name: Setup Gradle
42+
uses: gradle/actions/setup-gradle@v4
43+
with:
44+
gradle-version: "8.10.2"
45+
validate-wrappers: false
46+
add-job-summary-as-pr-comment: 'always'
47+
add-job-summary: 'always'
48+
49+
# - name: Validate Gradle Wrapper
50+
# uses: gradle/actions/wrapper-validation@v4
51+
52+
- name: Build with Gradle
53+
run: gradle build
54+
55+
- name: Upload build reports
56+
uses: actions/upload-artifact@v4
57+
if: always()
58+
with:
59+
name: build-reports
60+
path: '**/build/reports/'
61+
62+
maven-build:
63+
name: Build with Maven
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Checkout sources
67+
uses: actions/checkout@v4
68+
69+
- name: Set up JDK 21
70+
uses: actions/setup-java@v3
71+
with:
72+
java-version: 21
73+
distribution: 'temurin'
74+
cache: maven
75+
architecture: x64
76+
77+
- name: Build and Install
78+
run: mvn -B clean install
79+
80+
- name: Build, Package and Test
81+
run: mvn -B jacoco:prepare-agent clean test package surefire-report:report jacoco:report
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request,
4+
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
5+
# Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable
6+
# packages will be blocked from merging.
7+
#
8+
# Source repository: https://github.com/actions/dependency-review-action
9+
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
10+
name: 'Dependency Review'
11+
on:
12+
pull_request:
13+
branches: [ 'main' ]
14+
15+
permissions:
16+
contents: read
17+
pull-requests: write
18+
security-events: write
19+
20+
jobs:
21+
dependency-review:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: 'Checkout repository'
25+
uses: actions/checkout@v4
26+
27+
- name: 'Dependency Review'
28+
uses: actions/dependency-review-action@v4
29+
with:
30+
comment-summary-in-pr: always
31+
fail-on-severity: moderate
32+
vulnerability-check: true
33+
deny-licenses: GPL-1.0-or-later, LGPL-2.0-or-later
34+
retry-on-snapshot-warnings: true
35+
show-openssf-scorecard: true

β€Ž.github/workflows/maven.yml

-40
This file was deleted.

β€Ž.mvn/extensions.xml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<extensions>
3+
<extension>
4+
<groupId>co.leantechniques</groupId>
5+
<artifactId>maven-buildtime-extension</artifactId>
6+
<version>3.0.5</version>
7+
</extension>
8+
</extensions>

β€Ž.mvn/jvm.config

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Xss16m -Xms256m -Xmx1024m -Djava.awt.headless=true

β€ŽJenkinsfile

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
pipeline {
2+
agent any
3+
options {
4+
skipStagesAfterUnstable()
5+
}
6+
tools {
7+
maven 'maven'
8+
jdk 'jdk21'
9+
}
10+
stages {
11+
stage('Verify') {
12+
steps {
13+
sh 'mvn --version'
14+
sh 'java --version'
15+
}
16+
}
17+
stage('Build') {
18+
steps {
19+
sh 'mvn -DskipTests clean install -B --no-transfer-progress'
20+
}
21+
}
22+
23+
stage('Test') {
24+
steps {
25+
sh 'mvn test'
26+
}
27+
post {
28+
always {
29+
junit 'target/surefire-reports/*.xml'
30+
}
31+
}
32+
}
33+
34+
stage('Deliver') {
35+
steps {
36+
sh './jenkins/scripts/deliver.sh'
37+
}
38+
}
39+
}
40+
}

β€ŽREADME.md

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
# QuickStart-Coding-Challenges
2-
3-
Quickstart Coding Challenges
4-
1+
# Quickstart Coding Challenges
52

63
[![Java CI with Maven](https://github.com/shortthirdman/QuickStart-Coding-Challenges/actions/workflows/maven.yml/badge.svg?event=workflow_dispatch)](https://github.com/shortthirdman/QuickStart-Coding-Challenges/actions/workflows/maven.yml)
74

8-
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/shortthirdman/QuickStart-Coding-Challenges) ![GitHub](https://img.shields.io/github/license/shortthirdman/QuickStart-Coding-Challenges) ![GitHub last commit](https://img.shields.io/github/last-commit/shortthirdman/QuickStart-Coding-Challenges)
5+
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/shortthirdman/QuickStart-Coding-Challenges) ![GitHub](https://img.shields.io/github/license/shortthirdman/QuickStart-Coding-Challenges) ![GitHub last commit](https://img.shields.io/github/last-commit/shortthirdman/QuickStart-Coding-Challenges) ![Maintenance](https://img.shields.io/maintenance/yes/2024)
96

107
All Java solutions for various challenges presented during interviews for software development positions.
118

@@ -16,16 +13,23 @@ All Java solutions for various challenges presented during interviews for softwa
1613

1714
## Requirements
1815

19-
- Apache Maven 3.9.x
20-
- Java 21
21-
- JetBrains IntelliJ IDEA (Community/Ultimate)
16+
- [Apache Maven 3.9.x](https://maven.apache.org/)
17+
- [OpenJDK/Oracle Java 21](https://www.oracle.com/java/technologies/downloads/)
18+
- [JetBrains IntelliJ IDEA (Community/Ultimate)](https://www.jetbrains.com/idea/)
2219

2320

2421
## Run, Test and Code Coverage
2522

26-
`mvn clean install test`
23+
```shell
24+
mvn jacoco:prepare-agent clean test surefire-report:report jacoco:report
25+
```
26+
27+
## Release and Tag
28+
29+
```shell
30+
mvn jacoco:prepare-agent clean test surefire-report:report jacoco:report -Prelease
31+
```
2732

28-
`mvn jacoco:prepare-agent clean test jacoco:report`
2933

3034
## Contributing
3135

0 commit comments

Comments
Β (0)