Skip to content

Commit

Permalink
Edit wf file
Browse files Browse the repository at this point in the history
  • Loading branch information
boogeroccam committed Nov 16, 2024
1 parent 019794b commit bdcbd0a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 14 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download binary artifact
uses: actions/download-artifact@v4
with:
Expand All @@ -59,11 +59,23 @@ jobs:
version: "latest"

- name: Run tests
run: make test
run: |
make test
if [ -f "report.md" ]; then
echo "<details><summary>Failed Test Report</summary>" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat report.md >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
fi
- name: Test status check
- name: Render the report to the PR when tests fail
uses: marocchino/sticky-pull-request-comment@v2
if: failure()
run: exit 1
with:
header: test-report
recreate: true
path: ${{ env.REPORT_FILE }}

permissions:
pull-requests: write
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ build-alpine:
@GOOS=linux CGO_ENABLED=1 go build -ldflags="-w -s" -o $(BUILDDIR)/$(GALACTICA_BINARY) ./cmd/galacticad

localnet-build:
@make build
@$(MAKE) build
@echo "Build docker image for localnet..."
@./localnet/build-docker.sh

Expand Down
25 changes: 17 additions & 8 deletions tests/galacli/Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
uname=$(shell uname -s)
is_darwin :=$(filter Darwin,$(uname))
all: ## run tests
all: $(if $(is_darwin),network,) clean start_test

all: $(if $(is_darwin),network,) clean start
help: ## Show this help
@printf "\033[33m%s:\033[0m\n" 'Available commands'
@awk 'BEGIN {FS = ":.*?## "} /^[[:alpha:][:punct:]]+:.*?## / {printf " \033[32m%-18s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

clean:
rm -rf node0* .pytest_cache __pycache__

.venv/bin/python:
.venv/bin/pytest .venv/bin/python:
uv venv
uv sync

start: ## just run galacli.py for debugging purpose
start: .venv/bin/python
pytest -v .
# .venv/bin/python galacli.py
ps:
.venv/bin/python galacli.py

start_test: .venv/bin/pytest ## start tests
.venv/bin/pytest -v .

ps: ## show running galacticad processes
-@ps | grep galacticad | grep -v 'grep'

terminate: ps
terminate: ps ## terminate running galacticad processes
ps | grep galacticad | grep -v 'grep' | awk '{print $$1}' | xargs -n1 kill -15
kill: ps

kill: ps ## kill running galacticad processes
ps | grep galacticad | grep -v 'grep' | awk '{print $$1}' | xargs -n1 sudo kill -9

ifeq ($(uname),Darwin)
network: /tmp/127.0.0.2 /tmp/127.0.0.3 /tmp/127.0.0.4
network: /tmp/127.0.0.2 /tmp/127.0.0.3 /tmp/127.0.0.4 ## assume you are using macos for development
/tmp/127.0.0.%:
sudo ifconfig lo0 alias $(shell basename $@) up && touch $@
endif
2 changes: 1 addition & 1 deletion tests/galacli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies = [
[tool.pytest.ini_options]
md_report_output = "report.md"
md_report = true
md_report_verbose = 0
md_report_verbose = 1
md_report_color = "never"

# asyncio_mode = "auto"
Expand Down

0 comments on commit bdcbd0a

Please sign in to comment.