From 54184f96d1fbe8c8a88953317ca80b8933fabfcd Mon Sep 17 00:00:00 2001 From: xun Date: Tue, 26 Dec 2023 20:43:28 +0800 Subject: [PATCH 1/2] add: add prebuild action and correct error link in README --- .github/workflows/test.yml | 10 ++++++++++ README.md | 2 +- test.sh | 10 ++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml create mode 100644 test.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6bf696b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,10 @@ +on: pull_request +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Install mkdocs + run: pip install mkdocs-material + + - name: Test + run: bash test.sh diff --git a/README.md b/README.md index 415dfa2..41b6727 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,5 @@ - [南科手册](https://sustech.online/surroundings/) # 贡献 -如果你想贡献内容,请仔细阅读 [CONTRIBUTION.md](/CONTRIBUTION.html) +如果你想贡献内容,请仔细阅读 [CONTRIBUTION.md](/CONTRIBUTION.md) diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..dce901e --- /dev/null +++ b/test.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +ORIGDIR=$PWD +git switch upstream/main +cd .. +git clone https://github.com/NJUPT-SAST/sast-wiki.git +cd sast-wiki +git switch main +cp -r $ORIGDIR docs/ +mkdocs build From 8c182432b088950ff351c577d0866d5548048c26 Mon Sep 17 00:00:00 2001 From: xun Date: Tue, 26 Dec 2023 21:18:40 +0800 Subject: [PATCH 2/2] fix: test.sh does not run correctly. --- .github/workflows/test.yml | 4 ++++ test.sh | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6bf696b..f56af50 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,5 +6,9 @@ jobs: - name: Install mkdocs run: pip install mkdocs-material + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Test run: bash test.sh diff --git a/test.sh b/test.sh index dce901e..a11e50e 100644 --- a/test.sh +++ b/test.sh @@ -1,7 +1,6 @@ #!/bin/bash ORIGDIR=$PWD -git switch upstream/main cd .. git clone https://github.com/NJUPT-SAST/sast-wiki.git cd sast-wiki