doc: update doc test for installation instructions
This commit is contained in:
88
.github/workflows/doc.yml
vendored
88
.github/workflows/doc.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
args: README.md
|
args: README.md
|
||||||
|
|
||||||
doc_test:
|
remote_install:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
@@ -58,7 +58,42 @@ jobs:
|
|||||||
set -x
|
set -x
|
||||||
source doc/_readme/scripts/install_ubuntu.sh
|
source doc/_readme/scripts/install_ubuntu.sh
|
||||||
|
|
||||||
- name: Install llgo
|
- name: Test doc code blocks
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
source doc/_readme/scripts/run.sh
|
||||||
|
|
||||||
|
local_install:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- macos-latest
|
||||||
|
- ubuntu-24.04
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.23'
|
||||||
|
|
||||||
|
- name: Install dependencies on macOS
|
||||||
|
if: startsWith(matrix.os, 'macos')
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
source doc/_readme/scripts/install_macos.sh
|
||||||
|
|
||||||
|
- name: Install dependencies on Ubuntu
|
||||||
|
if: startsWith(matrix.os, 'ubuntu')
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
source doc/_readme/scripts/install_ubuntu.sh
|
||||||
|
|
||||||
|
- name: Install llgo with tools
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
@@ -79,3 +114,52 @@ jobs:
|
|||||||
set -x
|
set -x
|
||||||
source doc/_readme/scripts/run.sh
|
source doc/_readme/scripts/run.sh
|
||||||
|
|
||||||
|
local_install_full:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- macos-latest
|
||||||
|
- ubuntu-24.04
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.23'
|
||||||
|
|
||||||
|
- name: Install dependencies on macOS
|
||||||
|
if: startsWith(matrix.os, 'macos')
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
source doc/_readme/scripts/install_macos.sh
|
||||||
|
|
||||||
|
- name: Install dependencies on Ubuntu
|
||||||
|
if: startsWith(matrix.os, 'ubuntu')
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
source doc/_readme/scripts/install_ubuntu.sh
|
||||||
|
|
||||||
|
- name: Install llgo with tools
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
git() {
|
||||||
|
if [ "$1" = "clone" ]; then
|
||||||
|
# do nothing because we already have the branch
|
||||||
|
cd ..
|
||||||
|
else
|
||||||
|
command git "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
source doc/_readme/scripts/install_full.sh
|
||||||
|
echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Test doc code blocks
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
source doc/_readme/scripts/run.sh
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -398,6 +398,15 @@ curl https://raw.githubusercontent.com/goplus/llgo/refs/heads/main/install.sh |
|
|||||||
|
|
||||||
TODO
|
TODO
|
||||||
|
|
||||||
|
### Install from source
|
||||||
|
|
||||||
|
<!-- embedme doc/_readme/scripts/install_llgo.sh#L2-L1000 -->
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/goplus/llgo.git
|
||||||
|
cd llgo
|
||||||
|
./install.sh
|
||||||
|
```
|
||||||
|
|
||||||
## Development tools
|
## Development tools
|
||||||
|
|
||||||
@@ -409,7 +418,7 @@ TODO
|
|||||||
|
|
||||||
How do I generate these tools?
|
How do I generate these tools?
|
||||||
|
|
||||||
<!-- embedme doc/_readme/scripts/install_llgo.sh#L2-L1000 -->
|
<!-- embedme doc/_readme/scripts/install_full.sh#L2-L1000 -->
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/goplus/llgo.git
|
git clone https://github.com/goplus/llgo.git
|
||||||
|
|||||||
9
doc/_readme/scripts/install_full.sh
Normal file
9
doc/_readme/scripts/install_full.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# shellcheck disable=all
|
||||||
|
git clone https://github.com/goplus/llgo.git
|
||||||
|
cd llgo/compiler
|
||||||
|
go install -v ./cmd/...
|
||||||
|
go install -v ./chore/... # compile all tools except pydump
|
||||||
|
export LLGO_ROOT=$PWD/..
|
||||||
|
cd ../_xtool
|
||||||
|
llgo install ./... # compile pydump
|
||||||
|
go install github.com/goplus/hdq/chore/pysigfetch@v0.8.1 # compile pysigfetch
|
||||||
@@ -1,9 +1,4 @@
|
|||||||
# shellcheck disable=all
|
# shellcheck disable=all
|
||||||
git clone https://github.com/goplus/llgo.git
|
git clone https://github.com/goplus/llgo.git
|
||||||
cd llgo/compiler
|
cd llgo
|
||||||
go install -v ./cmd/...
|
./install.sh
|
||||||
go install -v ./chore/... # compile all tools except pydump
|
|
||||||
export LLGO_ROOT=$PWD/..
|
|
||||||
cd ../_xtool
|
|
||||||
llgo install ./... # compile pydump
|
|
||||||
go install github.com/goplus/hdq/chore/pysigfetch@v0.8.1 # compile pysigfetch
|
|
||||||
|
|||||||
Reference in New Issue
Block a user