Skip to content

Commit

Permalink
First commit for open source
Browse files Browse the repository at this point in the history
  • Loading branch information
yinjiayi committed Sep 5, 2023
0 parents commit 8cb9c7d
Show file tree
Hide file tree
Showing 584 changed files with 40,395 additions and 0 deletions.
163 changes: 163 additions & 0 deletions .github/workflows/build-push-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Copyright (c) 2022 Institute of Software Chinese Academy of Sciences (ISCAS)
#
# Licensed 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: build and push container images

env:
REGISTRY: ghcr.io
EULIX_REGISTRY: ${{ secrets.EULIX_REGISTRY }}
IMAGE_NAME: ${{ github.repository }}
JAVA_VERSION: '17'

on:
push:
branches: [ "*" ]
tags: [ '*.*.*' ]
pull_request:
branches: [ "*" ]

jobs:
build-jvm-images:
runs-on: [self-hosted, linux, x64]
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v3

- name: Setup JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: temurin
cache: maven

- name: Build Package for JVM
run: |
./mvnw -B clean package -DskipTests=true \
-Dquarkus.http.host=0.0.0.0 \
-Dmaven.compiler.release=${{ env.JAVA_VERSION }}
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2

- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Log into registry ${{ env.EULIX_REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.EULIX_REGISTRY }}
username: ${{ secrets.EULIX_REGISTRY_USERNAME }}
password: ${{ secrets.EULIX_REGISTRY_PASSWORD }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v2
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
${{ env.EULIX_REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
prefix=jvm-
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
file: Dockerfile.jvm

build-native-images:
runs-on: [self-hosted, linux, x64]
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2

- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Log into registry ${{ env.EULIX_REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.EULIX_REGISTRY }}
username: ${{ secrets.EULIX_REGISTRY_USERNAME }}
password: ${{ secrets.EULIX_REGISTRY_PASSWORD }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v2
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
${{ env.EULIX_REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
file: Dockerfile
95 changes: 95 additions & 0 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Copyright (c) 2022 Institute of Software Chinese Academy of Sciences (ISCAS)
#
# Licensed 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.

## Ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

name: build and test

on:
push:
paths-ignore:
- '**/*.md'
- 'docs/**'
- '**/images/**'
branches:
- dev
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- dev
paths-ignore:
- '**/*.md'
- 'docs/**'
- '**/images/**'
workflow_dispatch:

env:
MANDREL_VERSION: "22.3.0.1-Final"
JAVA_VERSION: '17'

jobs:
jvm-build-test:
runs-on: [self-hosted, linux, x64]
steps:
- uses: actions/checkout@v3

- name: Setup Maven+JDK-${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
cache: maven

- name: Build and Verify for JVM
run: |
./mvnw -B clean verify \
-Dquarkus.http.host=0.0.0.0 \
-Dmaven.compiler.release=${{ env.JAVA_VERSION }}
native-build-test:
runs-on: [self-hosted, linux, x64]
steps:
- uses: actions/checkout@v3

- name: Cache and restore Mandrel distro
id: check-mandrel-cache
uses: actions/cache@v3
with:
path: mandrel-${{ env.MANDREL_VERSION }}-${{ env.JAVA_VERSION }}.tar.gz
key: mandrel-distro-${{ env.MANDREL_VERSION }}-${{ env.JAVA_VERSION }}

- name: Download Mandrel
if: steps.check-mandrel-cache.outputs.cache-hit != 'true'
run: |
jdk_url="https://github.com/graalvm/mandrel/releases/download/mandrel-${MANDREL_VERSION}/mandrel-java${JAVA_VERSION}-linux-amd64-${MANDREL_VERSION}.tar.gz"
wget -q -O mandrel-${{ env.MANDREL_VERSION }}-${{ env.JAVA_VERSION }}.tar.gz $jdk_url
- name: Setup Maven+MandrelJDK-${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
with:
distribution: 'jdkfile'
jdkFile: mandrel-${{ env.MANDREL_VERSION }}-${{ env.JAVA_VERSION }}.tar.gz
java-version: ${{ env.JAVA_VERSION }}
architecture: x64
cache: maven

- name: Build and Verify for Native
run: |
./mvnw -B clean verify -Pnative \
-Dquarkus.http.host=0.0.0.0 \
-Dmaven.compiler.release=${{ env.JAVA_VERSION }}
53 changes: 53 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright (c) 2022 Institute of Software Chinese Academy of Sciences (ISCAS)
#
# Licensed 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.

#Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
release.properties

# Eclipse
.project
.classpath
.settings/
bin/

# IntelliJ
.idea
*.ipr
*.iml
*.iws

# NetBeans
nb-configuration.xml

# Visual Studio Code
.vscode
.factorypath

# OSX
.DS_Store

# Vim
*.swp
*.swo

# patch
*.orig
*.rej

# Local environment
.env
Loading

0 comments on commit 8cb9c7d

Please sign in to comment.