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

update workflow #84

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
75 changes: 38 additions & 37 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,39 @@ on:
branches: main

jobs:
call-auto-formatter:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Install IntelliJ IDEA
run: |
wget -q -O idea.tar.gz https://download.jetbrains.com/idea/ideaIC-2024.1.1.tar.gz
tar -xzf idea.tar.gz

- name: Format code
run: |
./*/bin/format.sh -m *.java -r .

- name: Commit changes
run: |
git config user.name 'github-actions[bot]'
git config user.email "github-actions[bot]@users.noreply.github.com"
if ! git diff --exit-code > /dev/null
then
git commit -a -m "Auto-format code"
git push
fi

# Github Action to detect file changes between
# main branch and pull request branch
changes:
needs: [call-auto-formatter]
if: ${{ always() }}
runs-on: ubuntu-latest
outputs:
core: ${{ steps.filter.outputs.core }}
Expand Down Expand Up @@ -38,6 +68,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup JDK 17
uses: actions/setup-java@v3
Expand All @@ -58,6 +90,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup gradle
uses: gradle/gradle-build-action@v2
Expand Down Expand Up @@ -85,6 +119,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup gradle
uses: gradle/gradle-build-action@v2
Expand All @@ -108,6 +144,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup JDK 17
uses: actions/setup-java@v3
Expand All @@ -122,40 +160,3 @@ jobs:
- name: Run maven package on BundleServer
working-directory: ./bundleserver
run: mvn package

call-auto-formatter:
needs:
[
changes,
build-bundle-core,
build-bundle-client,
build-bundle-transport,
build-bundle-server,
]
if: ${{ always() }}
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Install IntelliJ IDEA
run: |
wget -q -O idea.tar.gz https://download.jetbrains.com/idea/ideaIC-2024.1.1.tar.gz
tar -xzf idea.tar.gz

- name: Format code
run: |
./*/bin/format.sh -m *.java -r .

- name: Commit changes
run: |
git config user.name 'github-actions[bot]'
git config user.email "github-actions[bot]@users.noreply.github.com"
if ! git diff --exit-code > /dev/null
then
git commit -a -m "Auto-format code"
git push
fi
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,6 @@ public class ServerWindow {
@Autowired
private Environment env;

// @Autowired
// public ServerWindow(ServerSecurity serverSecurity) throws SQLException
// {
// this.serverSecurity = serverSecurity;
// clientWindowMap = new HashMap<>();

// // TODO: Change to config
// String url = "jdbc:mysql://localhost:3306";
// String uname = "root";
// String password = "mchougule478";
// String dbName = "DTN_SERVER_DB";

// database = new SNRDatabases(url, uname, password, dbName);

// try {
// initializeWindow();
// } catch (SQLException | BufferOverflow | InvalidLength e) {
// System.out.println(e + "\n[WIN] INFO: Failed to initialize window from database");

// String dbTableCreateQuery = "CREATE TABLE " + dbTableName + " " +
// "(clientID VARCHAR(256) not NULL," +
// STARTCOUNTER + " VARCHAR(256)," +
// ENDCOUNTER + " VARCHAR(256)," +
// WINDOW_LENGTH + " INTEGER," +
// "PRIMARY KEY (clientID))";

// database.createTable(dbTableCreateQuery);
// }
// }

@PostConstruct
public void init() throws SQLException {
// TODO: Change to config
Expand Down