From fa737d482f1f647197d94b1a084caa15acd7087a Mon Sep 17 00:00:00 2001 From: Dict Xiong Date: Sat, 27 Aug 2022 01:42:15 +0800 Subject: [PATCH] ci: init ci (#12) * test.yml init * debug * debug * debug * debug * debug * debug * debug * debug --- .github/workflows/test.yml | 65 ++++++++++++++++++++++++++++++++++++++ tools/log.py | 7 ++-- 2 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5d5a239 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,65 @@ +name: test +on: + push: ~ + workflow_dispatch: ~ +jobs: + test: + name: test + runs-on: ubuntu-latest + steps: + - name: install dependencies + run: | + sudo apt update + sudo apt install -y git python3 python3-pip zsh curl inetutils-ping + sudo apt remove -y vim tmux + sudo pip3 install requests + + - name: checkout repo + uses: actions/checkout@v3 + + - name: install dfs + run: | + rev=`git rev-parse HEAD` + pwd + ./install.sh + git checkout $rev + + - name: antigen build + shell: /bin/zsh -ileo PIPE_FAIL {0} + run: | + echo $SHELL + antigen list + + - name: check files + shell: /bin/zsh -ileo PIPE_FAIL {0} + run: | + l ~ + l ~/.ssh + cat ~/.zshrc + + - name: check scripts and alias + shell: /bin/zsh -ileo PIPE_FAIL {0} + run: | + cd / + dfs + dfs cd + pwd + dfs version + dfs log 1 + l + dogo + tools/common.sh get_os_type + tools/common.sh get_linux_dist + bash -x tools/common.sh post_log 1 2 3 + + - name: check scripts and alias (no ret check) + shell: /bin/zsh -il {0} + run: | + p114 -c 4 + return 0 + + - name: check update + shell: /bin/zsh -ileo PIPE_FAIL {0} + run: | + dfs update + dfs version \ No newline at end of file diff --git a/tools/log.py b/tools/log.py index 9cc7c60..998661e 100644 --- a/tools/log.py +++ b/tools/log.py @@ -63,10 +63,11 @@ if __name__ == "__main__": logging.info("200 ok") exit(0) elif resp.status_code == 403: - logging.error("403 forbidden") + logging.warning("403 forbidden") logging.info("you may need to register your hostname and uuid") + logging.info(f"hostname: {hostname}, uuid: {uuid}") + exit(0) else: logging.error("unknown error ") logging.error(f"{resp.status_code}: {resp.text}") - logging.info(f"hostname: {hostname}, uuid: {uuid}") - exit(1) + exit(1)