Skip to content

Commit

Permalink
Merge pull request #113 from mbien/gh-actions
Browse files Browse the repository at this point in the history
Added github actions for basic build/test setup.
  • Loading branch information
mbien authored Dec 27, 2021
2 parents 9a7f701 + 85d3589 commit 683ca63
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 18 deletions.
39 changes: 21 additions & 18 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,24 @@ jobs:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml

- name: Build with Maven
run: mvn -DskipTests=true -V -ntp install

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'zulu'

- name: Checkout Project
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml

- name: Build with Maven
run: mvn -DskipTests=true -V -ntp install

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
70 changes: 70 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Apache Roller

# junit report action
# https://github.com/marketplace/actions/junit-report-action

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build-test:
name: Build+Test on Linux/JDK ${{ matrix.java }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
java: [ '11', '17' ]

steps:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'

- name: Checkout Project
uses: actions/checkout@v2

- name: Build Roller and run JUnit Tests
run: mvn -V -ntp install

- name: Run Integration Tests
run: |
cd it-selenium
bash -c "wget -c https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-linux64.tar.gz -O - | tar -xz"
mvn -V -ntp install
- name: Publish JUnit Report
uses: mikepenz/action-junit-report@v2
if: always()
with:
check_name: JUnit Reports for Linux/JDK ${{ matrix.java }}
report_paths: 'app/target/surefire-reports/TEST-*.xml'

- name: Publish IT Report
uses: mikepenz/action-junit-report@v2
if: always()
with:
check_name: IT Reports for Linux/JDK ${{ matrix.java }}
report_paths: 'it-selenium/target/failsafe-reports/TEST-*.xml'
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import org.junit.jupiter.api.Disabled;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Expand Down Expand Up @@ -87,6 +88,7 @@ void isBanned3() {
assertFalse(ipBanList.isBanned(null));
}

@Disabled
@Test
@DisplayName("isBanned() reads the file if needed")
void isBanned4() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package org.apache.roller.selenium;

import java.awt.GraphicsEnvironment;
import java.util.concurrent.TimeUnit;
import org.apache.roller.selenium.core.CreateWeblogPage;
import org.apache.roller.selenium.core.LoginPage;
Expand Down Expand Up @@ -55,6 +56,9 @@ public void setUp() throws Exception {
profile.setPreference("intl.accept_languages", "en_US");

FirefoxOptions options = new FirefoxOptions();
if (GraphicsEnvironment.isHeadless()) {
options.addArguments("-headless");
}
options.setProfile(profile);

driver = new FirefoxDriver(options);
Expand Down

0 comments on commit 683ca63

Please sign in to comment.