-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dynamic_triangles_2
- Loading branch information
Showing
97 changed files
with
3,811 additions
and
3,559 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,37 @@ | ||
name: Style Check | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
style-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install tools | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y --no-install-recommends cpplint shfmt | ||
sudo wget https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64 -O /bin/hadolint && sudo chmod +x /bin/hadolint | ||
pip install pylint | ||
- name: hadolint check | ||
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip hadolint Check')}} | ||
run: find . -type f -name '*Dockerfile*' -print0 | xargs -0 hadolint --ignore DL3008 --ignore DL3013 -t warning | ||
|
||
- name: shfmt check | ||
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip shfmt Check')}} | ||
run: find . -type f -name '*.sh' -print0 | xargs -0 shfmt -d -s -i 4 -ci | ||
|
||
- name: cpplint check | ||
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip cpplint Check')}} | ||
run: cpplint --linelength=120 --filter=-build,-runtime,-readability/todo,-whitespace/todo,-readability/casting,-readability/braces,-readability/fn_size,-legal/copyright --recursive . | ||
|
||
- name: pylint check | ||
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip pylint Check')}} | ||
run: pylint -d C0103,E0401,R0801,R0902,R0913,R0914,R0915,W0603,W0621,W0718 --recursive=y . | ||
style-check: | ||
runs-on: ubuntu-latest | ||
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip style check')}} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install tools | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y --no-install-recommends cpplint shfmt | ||
sudo wget https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64 -O /bin/hadolint && sudo chmod +x /bin/hadolint | ||
pip install pylint | ||
- name: hadolint check | ||
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip hadolint Check')}} | ||
run: find . -type f -name '*Dockerfile*' -print0 | xargs -0 hadolint --ignore DL3008 --ignore DL3013 -t warning | ||
|
||
- name: shfmt check | ||
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip shfmt Check')}} | ||
run: find . -type f -name '*.sh' -print0 | xargs -0 shfmt -d -s -i 4 -ci | ||
|
||
- name: cpplint check | ||
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip cpplint Check')}} | ||
run: cpplint --linelength=120 --filter=-build,-runtime,-readability/todo,-whitespace/todo,-readability/casting,-readability/braces,-readability/fn_size,-legal/copyright --recursive . | ||
|
||
- name: pylint check | ||
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip pylint Check')}} | ||
run: pylint -d C0103,E0401,R0801,R0902,R0913,R0914,R0915,W0603,W0621,W0718 --recursive=y . |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
env: | ||
IMAGE: "${{ secrets.DOCKER_USER }}/jasminegraph:${{ github.ref_name }}" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{github.ref}} | ||
repository: ${{ github.repository }} | ||
|
||
- name: Docker Build | ||
run: | | ||
sed -i "s#org.jasminegraph.k8s.image=.*#org.jasminegraph.k8s.image=${IMAGE}#" ./conf/jasminegraph-server.properties | ||
docker build -t "jasminegraph:temp" . | ||
CONTAINER_ID=$(docker create "jasminegraph:temp") | ||
docker export "${CONTAINER_ID}" | docker import - "jasminegraph:pre-build" | ||
docker build -t "${IMAGE}" -f .github/workflows/resources/Dockerfile . | ||
- name: Docker Minimal Image Build | ||
run: | | ||
sed -i "s#org.jasminegraph.k8s.image=.*#org.jasminegraph.k8s.image=${IMAGE}-minimal#" ./conf/jasminegraph-server.properties | ||
chmod +x ./minimal/build.sh | ||
./minimal/build.sh | ||
docker tag "jasminegraph:minimal" "${IMAGE}-minimal" | ||
- name: Docker Login | ||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }} | ||
|
||
- name: Docker Push | ||
run: | | ||
docker push "${IMAGE}" | ||
docker push "${IMAGE}-minimal" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM jasminegraph:pre-build | ||
|
||
ENV HOME="/home/ubuntu" | ||
ENV JASMINEGRAPH_HOME="${HOME}/software/jasminegraph" | ||
|
||
WORKDIR "${JASMINEGRAPH_HOME}" | ||
|
||
ENTRYPOINT ["/home/ubuntu/software/jasminegraph/run-docker.sh"] | ||
CMD ["bash"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
# Function to check if pod is in Pending/Running state | ||
pod_status="" | ||
check_pod_status() { | ||
pod_status=$(kubectl get pod jasminegraph-unit-test-pod --no-headers -o custom-columns=":status.phase") | ||
|
||
if [[ $pod_status == "Pending" || $pod_status == "ContainerCreating" ]]; then | ||
echo 0 | ||
else | ||
echo 1 | ||
fi | ||
} | ||
|
||
mkdir coverage | ||
kubectl apply -f ./k8s/configs.yaml | ||
kubectl apply -f ./.github/workflows/resources/unit-test-conf.yaml | ||
|
||
timeout=300 # Set the timeout in seconds (adjust as needed) | ||
start_time=$(date +%s) | ||
|
||
while [[ $(check_pod_status) == "0" ]]; do | ||
sleep 10 | ||
|
||
current_time=$(date +%s) | ||
elapsed_time=$((current_time - start_time)) | ||
|
||
if [[ $elapsed_time -ge $timeout ]]; then | ||
echo "Timeout reached. Exiting loop." | ||
break | ||
fi | ||
done | ||
|
||
echo "----------------------------- logs -----------------------------" | ||
kubectl logs -f jasminegraph-unit-test-pod | ||
|
||
check_pod_status | ||
if [[ $pod_status != "Running" && $pod_status != "Completed" ]]; then | ||
echo "Pod jasminegraph-unit-test-pod is in $pod_status state" | ||
echo "Unit tests failed" | ||
echo "----------------------------- details --------------------------" | ||
kubectl describe pod jasminegraph-unit-test-pod | ||
exit 1 | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,4 +84,5 @@ __pycache__ | |
*.db | ||
*.db-* | ||
|
||
coverage.xml | ||
coverage.xml | ||
*.tmp |
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 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 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 file was deleted.
Oops, something went wrong.
Oops, something went wrong.