Skip to content
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

a test PR #201

Open
wants to merge 53 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
fc63fc0
Delete .github/workflows directory
anosh-ar May 6, 2024
dbe3bee
Create CI.yml
anosh-ar May 6, 2024
e66a48e
Update CI.yml
anosh-ar May 6, 2024
5e73555
Update CI.yml
anosh-ar May 6, 2024
78bd15c
Update CI.yml
anosh-ar May 6, 2024
b37d6b7
Run the workflow at the same time on three different OS
anosh-ar May 6, 2024
271e2d2
Run the workflow on a local runner(aws)
anosh-ar May 7, 2024
b77ea08
Updated the label of local runner
anosh-ar May 7, 2024
86cf773
run on faps-scalable-runner
anosh-ar May 20, 2024
a032cc7
build image and push to Dockerhub
anosh-ar Jun 4, 2024
194f095
run on github runner
anosh-ar Jun 4, 2024
13b8020
build image and push to Dockerhub using FAPS-turing
anosh-ar Jun 4, 2024
e41ef7b
run on github runner
anosh-ar Jun 4, 2024
9744b12
build image and push to Dockerhub using github runner
anosh-ar Jun 4, 2024
a069781
Update Dockerfile
anosh-ar Jun 4, 2024
bd4d9f2
Create a publish job
anosh-ar Jun 6, 2024
168c4d5
Update CI.yml
anosh-ar Jun 6, 2024
3cea428
added new .py files to project
anosh-ar Jun 6, 2024
7e97e37
Create lint.yml
anosh-ar Jun 7, 2024
b3ba536
ignore paths added
anosh-ar Jun 7, 2024
ed449cd
corrected path
anosh-ar Jun 7, 2024
c10c971
Update lint.yml
anosh-ar Jun 7, 2024
9d6d537
Update lint.yml
anosh-ar Jun 7, 2024
aa77258
Update lint.yml
anosh-ar Jun 7, 2024
bdf222c
a test syntax error
anosh-ar Jun 7, 2024
672b4e6
Update lint.yml
anosh-ar Jun 7, 2024
c2433dc
Update lint.yml
anosh-ar Jun 7, 2024
574d563
Update lint.yml
anosh-ar Jun 7, 2024
dd656fb
Update lint.yml
anosh-ar Jun 7, 2024
4d84063
linting using intentional error
anosh-ar Jun 7, 2024
dbbb4aa
Update CI.yml with original docker action
anosh-ar Jun 14, 2024
6bc3285
Update CI.yml
anosh-ar Jun 14, 2024
d1d488f
Adding original slack action
anosh-ar Jun 14, 2024
5dfbe9b
using original actions
anosh-ar Jun 14, 2024
8cc428d
Update lint.yml
anosh-ar Jun 14, 2024
bd012f0
Update lint.yml
anosh-ar Jun 14, 2024
5fe4ead
Update lint.yml
anosh-ar Jun 14, 2024
94dd28f
Update lint.yml
anosh-ar Jun 14, 2024
fbf8cca
Update lint.yml
anosh-ar Jun 14, 2024
1d80a79
Create lint_reusable.yml
anosh-ar Jun 15, 2024
736aedd
Update lint.yml
anosh-ar Jun 15, 2024
bfaa406
Update lint.yml
anosh-ar Jun 15, 2024
11b0fbc
Update lint.yml
anosh-ar Jun 15, 2024
29fef6a
Update lint_reusable.yml
anosh-ar Jun 15, 2024
fd45d23
Create greetings
anosh-ar Jul 16, 2024
00a6b8d
run on ARC local host
anosh-ar Aug 18, 2024
0fd8099
reverted
anosh-ar Aug 18, 2024
fdf1691
run on ARC local host
anosh-ar Aug 18, 2024
a34bf7d
run on ARC local host
anosh-ar Aug 18, 2024
905ad31
Update lint.yml
anosh-ar Aug 18, 2024
d63176f
Update lint.yml
anosh-ar Aug 18, 2024
b8993f0
Update lint.yml
anosh-ar Aug 18, 2024
41852cd
run on ARC local host
anosh-ar Aug 18, 2024
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
79 changes: 79 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 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.
# This workflow will build a Java project with Gradle 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-gradle

name: Java CI with Gradle

on:
push:
branches: [ "master" ]
paths-ignore:
- 'src/python/**'
- '.github/workflows/lint.yml'
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest
# strategy:
# matrix:
# os: [windows-latest,ubunto-latest,macos-latest]
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build


docker:
needs: build
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: anoshrz/java_project:latest

- name: Log out from Docker Hub
run: docker logout
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
#
# - name: Setup Gradle
# uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
# with:
# gradle-version: '8.5'
#
# - name: Build with Gradle 8.5
# run: gradle build

38 changes: 0 additions & 38 deletions .github/workflows/ci.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .github/workflows/greetings
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Greetings

on: [pull_request, issues]

jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Welcome on your first issue'
pr-message: 'Message that will be displayed on users first pr'
12 changes: 12 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Lint and Format Code
on:
push:
paths:
- 'src/python/**'
- '.github/workflows/lint.yml'
jobs:
lint-and-format:
uses: anosh-ar/FAPS_Github_Action/.github/workflows/lint_reusable.yml@master
secrets:
SLACK_WEBHOOK_URL: ${{secrets.SLACK_WEBHOOK_URL}}

41 changes: 41 additions & 0 deletions .github/workflows/lint_reusable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Reusable Linting to Slack
on:
workflow_call:
secrets:
SLACK_WEBHOOK_URL:
required: true

jobs:
lint-and-format:
runs-on: arc-runner-set
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black pylint
- name: Format code with Black
run: black .
- name: Run pylint
id: lint
continue-on-error: true
run: pylint ./**/**.py > pylint_report.txt

- name: Send code rating to slack
run: |
RATING=$(grep -oP "Your code has been rated at \K[0-9\.]+/[0-9\.]+" pylint_report.txt)
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"Your code rating of your recent push is: ${RATING}\"}" ${{ secrets.SLACK_WEBHOOK_URL }}

- name: Check for critical pylint errors
id: pylint_check
run: |
if grep -E "E[0-9]+" pylint_report.txt; then
echo "Critical pylint errors found in the code. Please check pylint_report.txt for details."
ERROR_MSG=$(grep -E "E[0-9]+" pylint_report.txt)
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"Critical linting errors found in the code. Please check the logs for details:\n\`\`\`$ERROR_MSG\`\`\`\"}" ${{ secrets.SLACK_WEBHOOK_URL }}
fi
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM openjdk:8-jre-alpine

EXPOSE 8080

COPY ./build/libs/my-app-1.0-SNAPSHOT.jar /usr/app/
#COPY ./build/libs/my-app-1.0-SNAPSHOT.jar /usr/app/
WORKDIR /usr/app

ENTRYPOINT ["java", "-jar", "my-app-1.0-SNAPSHOT.jar"]
34 changes: 34 additions & 0 deletions src/python/preprocessing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import pandas as pd


def merge_data():

# Paths to the CSV files
csv_file_1 = "sources/qa.csv" # Answer
csv_file_2 = "sources/cncf_stackoverflow_qas.csv" # answer

# Read the CSV files
df1 = pd.read_csv(csv_file_1)
df2 = pd.read_csv(csv_file_2)

# Select and rename the columns of interest from the first file
df1_selected = df1[["Question", "Answer", "Project"]]

# Select and rename the columns of interest from the second file

df2_selected = df2[["question", "answer", "tag"]].rename(
columns={"question": "Question", "answer": "Answer", "tag": "Project"}
)

# Concatenate the selected and renamed columns
merged_df = pd.concat([df1_selected, df2_selected])

# Save the merged DataFrame to a new CSV file
merged_df.to_csv("merged_qas.csv", index=False)

print("Columns merged and saved successfully!")


if __name__ == "__main__":
merge_data()
print(test_wrong_value)
Loading