This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
SOFA Serverless Runtime Snapshot #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: SOFA Serverless Runtime Snapshot | |
## https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release | |
## trigger manually | |
on: | |
workflow_dispatch: | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build with Maven | |
working-directory: sofa-serverless-runtime | |
run: mvn clean install -DskipTests -B -U -e && sh ./check_format.sh | |
- name: Set up Docker | |
uses: docker/metadata-action@v3 | |
with: | |
images: | | |
node:14 | |
- name: get sofa-runtime version & update sofa-runtime version for all test sample app | |
run: | | |
serverless_runtime_version=$(find sofa-serverless-runtime/sofa-serverless-common -name "*.jar" |grep -v source |sed "s/.*sofa-serverless-common-\(.*\).jar/\1/") | |
echo "升级sofa-runtime version to $serverless_runtime_version" | |
for testsample in `find samples -name "*[^3|^dubbo]-samples"`;do sed -i "s/<sofa.serverless.runtime.version>.*<\/sofa.serverless.runtime.version>/<sofa.serverless.runtime.version>$serverless_runtime_version<\/sofa.serverless.runtime.version>/g" $testsample/pom.xml ;done | |
for testsample in `find samples -name "*[^3|^dubbo]-samples"`;do if cat $testsample/pom.xml |grep "<sofa.serverless.runtime.version>"|grep $serverless_runtime_version;then echo "版本校验通过";else echo "版本校验失败";exit 1;fi;done | |
- name: Test Env prepare | |
run: | | |
sudo apt-get update >>/tmp/envprepare.out | |
sudo apt-get install -y expect >>/tmp/envprepare.out | |
docker pull mongo:7.0.2-jammy | |
docker run --name mongodb -d -p 27017:27017 -v /home/runner/work/data:/data/db mongo:7.0.2-jammy | |
docker pull zookeeper:3.9.0 | |
docker run -p 2181:2181 -it --name zookeeper --restart always -d zookeeper:3.9.0 | |
sudo apt-get install redis-server -y | |
sudo systemctl start redis-server | |
sudo cp .github/workflows/ccbin/arkctl /usr/bin/arkctl | |
- name: Run jdk8 serverless runtime test | |
run: | | |
set -e | |
bash -x .github/workflows/ccbin/start.sh jdk8 | |
release_for_jdk8: | |
needs: build_and_test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
cache: maven | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase | |
- name: Build with Maven | |
run: mvn --batch-mode deploy -DskipTests -Psnapshot | |
working-directory: sofa-serverless-runtime | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |