Skip to content

Commit

Permalink
Merge branch 'microsoft:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
SOE-YoungS committed Nov 7, 2023
2 parents c883a62 + 164a7ec commit b87260c
Show file tree
Hide file tree
Showing 423 changed files with 90,633 additions and 411 deletions.
73 changes: 43 additions & 30 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ name: "CodeQL"

on:
push:
branches: [ "main", "experimental*", "feature*" ]
branches: ["main", "experimental*", "feature*", "*-development"]
schedule:
- cron: '17 11 * * 2'
- cron: "17 11 * * 2"

jobs:
analyze:
Expand All @@ -22,45 +22,58 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'csharp', 'python' ]
language: ["csharp", "python", "java"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
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.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
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.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
if: ${{ matrix.language != 'java' }}
uses: github/codeql-action/autobuild@v2

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, 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@v2
- name: Setup JDK
uses: actions/setup-java@v3
if: ${{ matrix.language == 'java' }}
with:
java-version: 17
distribution: microsoft
cache: maven

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- name: Build Java
if: ${{ matrix.language == 'java' }}
run: ./mvnw -B -DskipTests -Pcompile-jdk17 clean install --file pom.xml
working-directory: java

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
84 changes: 84 additions & 0 deletions .github/workflows/java-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build Java Semantic Kernel

on:
workflow_dispatch:
push:
branches: [ "main", "java-development" ]
paths:
- 'java/**'
pull_request:
branches: [ "main", "java-development" ]
paths:
- 'java/**'

permissions:
contents: read

jobs:
paths-filter:
runs-on: ubuntu-latest
outputs:
javaChanges: ${{ steps.filter.outputs.java }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
java:
- 'java/**'
- '**/java/**'
# run only if 'java' files were changed
- name: java tests
if: steps.filter.outputs.java == 'true'
run: echo "Java file"
# run only if not 'java' files were changed
- name: not java tests
if: steps.filter.outputs.java != 'true'
run: echo "NOT java file"
java-build:
runs-on: ubuntu-latest
needs: paths-filter
if: needs.paths-filter.outputs.javaChanges == 'true'
strategy:
fail-fast: false
matrix:
java-versions: [8, 17]

name: Java CI on JDK${{ matrix.java-versions }}

steps:
- name: Checkout
uses: actions/checkout@v3

# Need to use JDK 11 to build for JDK 8
- name: Set JDK
id: set-jdk
shell: bash
run: |
if [[ ${{ matrix.java-versions }} == 8 ]]; then
echo "JDK_VERSION=11" >> $GITHUB_OUTPUT
else
version=${{ matrix.java-versions }}
echo "JDK_VERSION=$version" >> $GITHUB_OUTPUT
fi
- uses: actions/setup-java@v3
with:
java-version: ${{ steps.set-jdk.outputs.JDK_VERSION }}
distribution: microsoft
cache: maven

- name: Build with Maven
run: ./mvnw -B -Pbug-check -DskipTests -Pcompile-jdk${{ matrix.java-versions }} clean install --file pom.xml
working-directory: java

- name: Run tests
run: ./mvnw -B -Pbug-check -Pcompile-jdk${{ matrix.java-versions }} test --file pom.xml
working-directory: java

- uses: actions/upload-artifact@v2
if: always()
with:
name: test_output_sk_jdk${{ matrix.java-versions }}u
path: java/**/target/surefire-reports/*Test.txt
91 changes: 91 additions & 0 deletions .github/workflows/java-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Run Java Integration Tests and Samples

on:
workflow_dispatch:
push:
branches: [ "main", "java-development" ]
paths:
- 'java/**'
pull_request:
branches: [ "main", "java-development" ]
paths:
- 'java/**'

permissions:
contents: read

jobs:
paths-filter:
runs-on: ubuntu-latest
outputs:
javaChanges: ${{ steps.filter.outputs.java }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
java:
- 'java/**'
- '**/java/**'
# run only if 'java' files were changed
- name: java tests
if: steps.filter.outputs.java == 'true'
run: echo "Java file"
# run only if not 'java' files were changed
- name: not java tests
if: steps.filter.outputs.java != 'true'
run: echo "NOT java file"
java-integration-tests:
runs-on: ubuntu-latest
needs: paths-filter
if: needs.paths-filter.outputs.javaChanges == 'true'
strategy:
fail-fast: false
matrix:
java-versions: [8, 17]

name: Java Tests on JDK${{ matrix.java-versions }}

steps:
- name: Checkout
uses: actions/checkout@v3

# Need to use JDK 11 to build for JDK 8
- name: Set JDK
id: set-jdk
shell: bash
run: |
if [[ ${{ matrix.java-versions }} == 8 ]]; then
echo "JDK_VERSION=11" >> $GITHUB_OUTPUT
else
version=${{ matrix.java-versions }}
echo "JDK_VERSION=$version" >> $GITHUB_OUTPUT
fi
- uses: actions/setup-java@v3
with:
java-version: ${{ steps.set-jdk.outputs.JDK_VERSION }}
distribution: microsoft
cache: maven

- name: Build with Maven
run: ./mvnw -B -Pbug-check -DskipTests -Pcompile-jdk${{ matrix.java-versions }} clean install --file pom.xml
working-directory: java

# API tests run on JDK 17+
- name: Run integration tests
run: ../mvnw -B -Pbug-check clean install --file pom.xml
working-directory: java/api-test
env:
OPENAI_API_KEY: ""
AZURE_OPENAI_ENDPOINT: ""
AZURE_OPENAI_API_KEY: ""
AZURE_OPENAI_DEPLOYMENT_NAME: ""
if: ${{ matrix.java-versions >= 17 }}

# Samples build on JDK 17+
- name: Build semantic-kernel samples
run: ../mvnw -B clean install --file pom.xml
working-directory: java/samples
if: ${{ matrix.java-versions >= 17 }}
18 changes: 9 additions & 9 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Check .md links
on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
branches: ["main", "java-development"]

permissions:
contents: read

Expand All @@ -13,11 +13,11 @@ jobs:
runs-on: ubuntu-latest
# check out the latest version of the code
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

# Checks the status of hyperlinks in .md files in verbose mode
- name: Check links
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-verbose-mode: 'yes'
config-file: ".github/workflows/markdown-link-check-config.json"
# Checks the status of hyperlinks in .md files in verbose mode
- name: Check links
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-verbose-mode: "yes"
config-file: ".github/workflows/markdown-link-check-config.json"
2 changes: 1 addition & 1 deletion .github/workflows/node-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: "yarn"
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/typos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ name: Spell Check
on:
workflow_dispatch:
pull_request:
branches: [ "main", "feature*" ]
branches: ["main", "java-development", "feature*"]

jobs:
run:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Check out code
uses: actions/checkout@v4

- name: Use custom config file
uses: crate-ci/typos@master
with:
config: .github/_typos.toml
write_changes: false
- name: Use custom config file
uses: crate-ci/typos@master
with:
config: .github/_typos.toml
write_changes: false
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ feature parity between our currently supported languages.
<td>
<img align="left" width=52px height=52px src="https://upload.wikimedia.org/wikipedia/en/3/30/Java_programming_language_logo.svg" alt="Java logo">
<div>
<a href="https://github.com/microsoft/semantic-kernel/blob/experimental-java/java/README.md">Using Semantic Kernel in Java</a>
<a href="https://github.com/microsoft/semantic-kernel/blob/main/java/README.md">Using Semantic Kernel in Java</a>
</div>
</td>
</tr>
Expand Down Expand Up @@ -80,8 +80,9 @@ from either OpenAI or Azure OpenAI and to run one of the C#, Python, and Java co

### For Java:

1. Clone and checkout the experimental Java branch: `git clone -b experimental-java https://github.com/microsoft/semantic-kernel.git`
2. Follow the instructions [here](https://github.com/microsoft/semantic-kernel/blob/experimental-java/java/samples/sample-code/README.md)
1. Clone the repository: `git clone https://github.com/microsoft/semantic-kernel.git`
1. To access the latest Java code, clone and checkout the Java development branch: `git clone -b java-development https://github.com/microsoft/semantic-kernel.git`
2. Follow the instructions [here](https://github.com/microsoft/semantic-kernel/blob/main/java/samples/sample-code/README.md)

## Learning how to use Semantic Kernel

Expand Down
Loading

0 comments on commit b87260c

Please sign in to comment.