Skip to content

Prepare for initial release 🌟 🥇 #4

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

Merged
merged 25 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
de967db
Initial Maven project commit
shortthirdman Sep 2, 2024
751ea0f
Changed repository and project in badges
shortthirdman Sep 2, 2024
ce4a303
Added test cases for new coding challenges and scenarios
shortthirdman Sep 12, 2024
35a5497
Fixes to several failed test cases and implemented new problem challe…
shortthirdman Sep 14, 2024
0ae2a61
Maven build and code-coverage configuration with `JaCoCo`
shortthirdman Sep 14, 2024
6bf27e0
Added default Maven GitHub Action workflow
shortthirdman Sep 14, 2024
9a35d89
Lint fixes for workflows/maven.yml
shortthirdman Sep 14, 2024
9a68cb7
Merge branch 'main' into develop
shortthirdman Sep 16, 2024
0817e54
[no ci] Added ReversePolishNotation and StoneWall implementation and …
shortthirdman Sep 20, 2024
cf35351
Added more tests in MinimumBinaryFlips with some modifications
shortthirdman Sep 20, 2024
7a3207a
Added new GitHub Action workflow for dependency review, new coding ch…
shortthirdman Sep 22, 2024
576b6c4
Added Jenkins CI configuration and new GitHub Action workflow
shortthirdman Sep 24, 2024
e8e9cf8
Changes to GHA workflows [skip ci]
shortthirdman Sep 28, 2024
a236cf8
Added GHA for CodeQL [no ci]
shortthirdman Sep 28, 2024
0492e6b
Added Gradle build to generate reports and test suites for release
shortthirdman Oct 12, 2024
05b8f95
[no ci] Removed CodeQL and Maven GHAs; Added combined CI workflow
shortthirdman Oct 12, 2024
b5bcf6b
Added binary tree operations and its test cases [no ci]
shortthirdman Oct 17, 2024
694336c
Added new challenge questions asked on Amazon interview
shortthirdman Nov 21, 2024
5d02c1c
maven: Added JVM and Maven extensions
shortthirdman Jan 14, 2025
7115f58
feat(challenge): Added new problem statements and their unit tests wi…
shortthirdman Feb 13, 2025
b4b6c09
feat(codesignal): Closes #3 for CountDistinctSlices
shortthirdman Feb 13, 2025
786ca7a
feat(codesignal): Removed EquiLeader implementation, closes #3
shortthirdman Feb 13, 2025
2244c95
ci(github): Reviewed and updated CI pipeline for GitHub Actions
shortthirdman Feb 13, 2025
3d3954d
ci(github): Re-configured GHA workflow for CI
shortthirdman Feb 13, 2025
721a3f1
bugfix(test-cases): Fixed all failing JUnit test cases
shortthirdman Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# This workflow will build a Java project with Maven, 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-maven

# 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.

name: Build and Release

on:
push:
branches: ['main']
pull_request:
branches: [ 'main' ]
workflow_dispatch:

permissions:
contents: read
packages: read
statuses: write # To report GitHub Actions status checks
actions: read # Needed for detection of GitHub Actions environment.
id-token: write # Needed for provenance signing and ID.
pull-requests: write

jobs:
gradle-build:
name: Build with Gradle
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
architecture: x64

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: "8.10.2"
validate-wrappers: false
add-job-summary-as-pr-comment: 'always'
add-job-summary: 'always'

# - name: Validate Gradle Wrapper
# uses: gradle/actions/wrapper-validation@v4

- name: Build with Gradle
run: gradle build

- name: Upload build reports
uses: actions/upload-artifact@v4
if: always()
with:
name: build-reports
path: '**/build/reports/'

maven-build:
name: Build with Maven
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

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

- name: Build and Install
run: mvn -B clean install

- name: Build, Package and Test
run: mvn -B jacoco:prepare-agent clean test package surefire-report:report jacoco:report
35 changes: 35 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request,
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
# Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable
# packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on:
pull_request:
branches: [ 'main' ]

permissions:
contents: read
pull-requests: write
security-events: write

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout repository'
uses: actions/checkout@v4

- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
with:
comment-summary-in-pr: always
fail-on-severity: moderate
vulnerability-check: true
deny-licenses: GPL-1.0-or-later, LGPL-2.0-or-later
retry-on-snapshot-warnings: true
show-openssf-scorecard: true
40 changes: 0 additions & 40 deletions .github/workflows/maven.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>co.leantechniques</groupId>
<artifactId>maven-buildtime-extension</artifactId>
<version>3.0.5</version>
</extension>
</extensions>
1 change: 1 addition & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Xss16m -Xms256m -Xmx1024m -Djava.awt.headless=true
40 changes: 40 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
pipeline {
agent any
options {
skipStagesAfterUnstable()
}
tools {
maven 'maven'
jdk 'jdk21'
}
stages {
stage('Verify') {
steps {
sh 'mvn --version'
sh 'java --version'
}
}
stage('Build') {
steps {
sh 'mvn -DskipTests clean install -B --no-transfer-progress'
}
}

stage('Test') {
steps {
sh 'mvn test'
}
post {
always {
junit 'target/surefire-reports/*.xml'
}
}
}

stage('Deliver') {
steps {
sh './jenkins/scripts/deliver.sh'
}
}
}
}
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# QuickStart-Coding-Challenges

Quickstart Coding Challenges

# Quickstart Coding Challenges

[![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)

![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)
![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)

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

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

## Requirements

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


## Run, Test and Code Coverage

`mvn clean install test`
```shell
mvn jacoco:prepare-agent clean test surefire-report:report jacoco:report
```

## Release and Tag

```shell
mvn jacoco:prepare-agent clean test surefire-report:report jacoco:report -Prelease
```

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

## Contributing

Expand Down
Loading
Loading