diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000000000000000000000000000000000..5dcacae866c5ebe1d583097bb10863f579608d8b --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,94 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +name: "CodeQL" + +on: + push: + branches: [master] + pull_request: + # The branches below must be a subset of the branches above + branches: [master] + schedule: + - cron: '36 4 * * 2' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # Override automatic language detection by changing the below list + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['java', 'javascript'] + # Learn more... + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + #- name: Autobuild + # uses: github/codeql-action/autobuild@v1 + + # âšī¸ Command-line programs to run using the OS shell. + # đ https://git.io/JvXDl + + # âī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + - uses: actions/checkout@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'temurin' + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Checkout fess-parent + uses: actions/checkout@v2 + with: + repository: codelibs/fess-parent + path: fess-parent + - name: Install fess-parent + run: | + cd fess-parent + mvn install + - name: Build with Maven + run: mvn -B package --file pom.xml + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 110b3c84af0a384558ce4a17ec0350b2fa8fe969..5291f9cba70e69ac98101842994a96da327fc556 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -16,10 +16,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: - java-version: '11' + java-version: '17' distribution: 'temurin' - uses: actions/cache@v1 with: diff --git a/pom.xml b/pom.xml index ec12353af1a94b76b863233dc46ec91e41b1ca38..6282acf92353ba23f08621eb0339d47f6842e2ec 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ <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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>fess</artifactId> - <version>13.15.1-SNAPSHOT</version> + <version>14.0.0-SNAPSHOT</version> <packaging>war</packaging> <name>Fess</name> <description>Fess is Full tExt Search System.</description> @@ -30,7 +30,7 @@ <parent> <groupId>org.codelibs.fess</groupId> <artifactId>fess-parent</artifactId> - <version>13.15.0</version> + <version>14.0.0-SNAPSHOT</version> <relativePath /> </parent> <properties> diff --git a/src/test/java/org/codelibs/fess/helper/DocumentHelperTest.java b/src/test/java/org/codelibs/fess/helper/DocumentHelperTest.java index dc6d99c7c2f00f8d408e1a46114192021849b5ec..01239707e9f139c7c9c01d567427d0005bbfec93 100644 --- a/src/test/java/org/codelibs/fess/helper/DocumentHelperTest.java +++ b/src/test/java/org/codelibs/fess/helper/DocumentHelperTest.java @@ -125,20 +125,20 @@ public class DocumentHelperTest extends UnitFessTestCase { DocumentHelper documentHelper = new DocumentHelper(); String hash = "01010101010101010101010101010101"; - String value = "$H4sIAAAAAAAAADMwNMALAXC7sg0gAAAA"; + String value = "$H4sIAAAAAAAA_zMwNMALAXC7sg0gAAAA"; assertEquals(value, documentHelper.encodeSimilarDocHash(hash)); hash = "00101010010010100100101010001010"; - value = "$H4sIAAAAAAAAADMwMARDCELQQApMAgAi5-3LIAAAAA"; + value = "$H4sIAAAAAAAA_zMwMARDCELQQApMAgAi5-3LIAAAAA"; assertEquals(value, documentHelper.encodeSimilarDocHash(hash)); hash = "0001010100100101001001010100010100101010010010100100101011000100"; - value = "$H4sIAAAAAAAAADMwMDAEQwhC0EAKxscqDZE3AABZOHx2QAAAAA"; + value = "$H4sIAAAAAAAA_zMwMDAEQwhC0EAKxscqDZE3AABZOHx2QAAAAA"; assertEquals(value, documentHelper.encodeSimilarDocHash(hash)); hash = "00100101010001010100100101001001010100010100010101010010010101010010101100010101001000010101001001010001000001010010101001001010"; - value = "$H4sIAAAAAAAAADMwMDQAIhCE01ARdBkYD1kGxkDVjWESRBBJPVwKAHL5QrqAAAAA"; + value = "$H4sIAAAAAAAA_zMwMDQAIhCE01ARdBkYD1kGxkDVjWESRBBJPVwKAHL5QrqAAAAA"; assertEquals(value, documentHelper.encodeSimilarDocHash(hash)); hash = ""; - value = "$H4sIAAAAAAAAAAMAAAAAAAAAAAA"; + value = "$H4sIAAAAAAAA_wMAAAAAAAAAAAA"; assertEquals(value, documentHelper.encodeSimilarDocHash(hash)); hash = "$H4sIAAAAAAAAAAMAAAAAAAAAAAA"; value = "$H4sIAAAAAAAAAAMAAAAAAAAAAAA";