name: ci on: push: branches: [main] pull_request: branches: [main] jobs: vet-and-test: runs-on: ubuntu-latest env: GOPROXY: https://goproxy.cn,direct steps: - name: Checkout env: TOKEN: ${{ secrets.GITHUB_TOKEN }} SUBMODULE_TOKEN: ${{ secrets.SUBMODULE_TOKEN }} run: | set -euo pipefail git init -q git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" git -c http.extraheader="AUTHORIZATION: token ${TOKEN}" fetch --depth=1 origin "${GITHUB_SHA}" git checkout -q --detach FETCH_HEAD if [ -z "${SUBMODULE_TOKEN}" ]; then echo "SUBMODULE_TOKEN is not configured" >&2 exit 1 fi git config --global url."https://weichen:${SUBMODULE_TOKEN}@git-home.u1680832.nyat.app:30319/".insteadOf "ssh://git@git-ssh.u1680832.nyat.app:31411/" git -c fetch.recurseSubmodules=false submodule update --init --recursive - name: Install Go 1.27.1 run: | set -euo pipefail curl -fsSL -o "$RUNNER_TEMP/go.tgz" https://mirrors.aliyun.com/golang/go1.27.1.linux-amd64.tar.gz tar -C /usr/local -xzf "$RUNNER_TEMP/go.tgz" ln -sfn /usr/local/go/bin/go /usr/local/bin/go ln -sfn /usr/local/go/bin/gofmt /usr/local/bin/gofmt - name: Install house-style Python packages run: python3 -m pip install --break-system-packages -i https://pypi.tuna.tsinghua.edu.cn/simple python-docx python-pptx openpyxl - name: Vet and test run: GOWORK=off go vet ./... && GOWORK=off go test -count=1 ./...