Skip to content

Commit

Permalink
Merge pull request #3 from BME-MIT-IET/setup-build-and-ci
Browse files Browse the repository at this point in the history
Setup build and ci
  • Loading branch information
ErikSkare authored May 19, 2024
2 parents 6b3f89b + 6b7bc76 commit 081611f
Show file tree
Hide file tree
Showing 22 changed files with 176 additions and 6 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: SonarCloud
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu' # Alternative distribution options are available.
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=BME-MIT-IET_iet-hf-2024-nomad-szabotorok
18 changes: 17 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
*.class
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar

# Eclipse m2e generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sonarlint.connectedMode.project": {
"connectionId": "bme-mit-iet-org",
"projectKey": "BME-MIT-IET_iet-hf-2024-nomad-szabotorok"
}
}
77 changes: 77 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>hu.bme.mit.iet.pipe_game</groupId>
<artifactId>pipe_game</artifactId>
<version>1.0-SNAPSHOT</version>

<name>pipe_game</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<sonar.organization>bme-mit-iet-org</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

//
//
// Generated by StarUML(tm) Java Add-In
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

import java.util.*;

public class Control {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
Expand All @@ -23,7 +25,7 @@ public void Run(){
this.setTitle("Sivatagi Vízhálózat");
this.setResizable(false);

JPanel menu = new JPanel();
final JPanel menu = new JPanel();

menu.setLayout(null);
menu.setPreferredSize(new Dimension(500,500));
Expand Down Expand Up @@ -77,7 +79,7 @@ public void actionPerformed(ActionEvent e) {
public void Settings(JPanel oldMenu) {
this.remove(oldMenu);

JPanel menu = new JPanel();
final JPanel menu = new JPanel();
menu.setLayout(null);
menu.setPreferredSize(new Dimension(500, 500));

Expand All @@ -90,21 +92,21 @@ public void Settings(JPanel oldMenu) {
kor.setFont(new Font("Arial", Font.BOLD, 30));

Integer[] szamok = new Integer[]{1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20};
JComboBox<Integer> roundNum = new JComboBox<>(szamok);
final JComboBox<Integer> roundNum = new JComboBox<>(szamok);
roundNum.setBounds(650, 240, 50, 20);

JLabel saboteur = new JLabel("Hány szabotőr legyen?", SwingConstants.LEFT);
saboteur.setBounds(150, 300, 500, 100);
saboteur.setFont(new Font("Arial", Font.BOLD, 30));

JComboBox<Integer> saboteurCount = new JComboBox<>(new Integer[]{2, 3, 4});
final JComboBox<Integer> saboteurCount = new JComboBox<>(new Integer[]{2, 3, 4});
saboteurCount.setBounds(650, 340, 50, 20);

JLabel mechanic = new JLabel("Hány szerelő legyen?", SwingConstants.LEFT);
mechanic.setBounds(150, 400, 500, 100);
mechanic.setFont(new Font("Arial", Font.BOLD, 30));

JComboBox<Integer> mechanicCount = new JComboBox<>(new Integer[]{2, 3, 4});
final JComboBox<Integer> mechanicCount = new JComboBox<>(new Integer[]{2, 3, 4});
mechanicCount.setBounds(650, 440, 50, 20);

JButton start = new JButton("Játék indítása");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

import java.io.IOException;

public class Main {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

//
//
// Generated by StarUML(tm) Java Add-In
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

//
//
// Generated by StarUML(tm) Java Add-In
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

import javax.sound.sampled.Line;
import javax.swing.*;
import javax.swing.border.CompoundBorder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

//
//
// Generated by StarUML(tm) Java Add-In
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

//
//
// Generated by StarUML(tm) Java Add-In
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

//
//
// Generated by StarUML(tm) Java Add-In
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

//
//
// Generated by StarUML(tm) Java Add-In
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

/**
* A forrás, ahonnan folyamatosan jön a víz. Ezt továbbítja a szomszédos csövekent.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package hu.bme.mit.iet.pipe_game;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
Expand Down
Empty file.

0 comments on commit 081611f

Please sign in to comment.