diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..a957fcb84 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,17 @@ +name: Check PR +on: pull_request + +jobs: + only: + name: Check formatting and links + runs-on: ubuntu-18.04 + container: + image: ghcr.io/void-linux/void-linux:latest-full-x86_64-musl + steps: + - name: Prepare container + run: | + xbps-install -Syu || xbps-install -yu xbps + xbps-install -yu + xbps-install -y mdbook-linkcheck vmdfmt git + - uses: actions/checkout@v1 + - run: ./res/ci/format.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 77f0e0dab..000000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -language: bash - -script: - - res/ci/format.sh - -notifications: - email: false diff --git a/res/ci/format.sh b/res/ci/format.sh index 5aaea40e9..fb39d2fb0 100755 --- a/res/ci/format.sh +++ b/res/ci/format.sh @@ -1,43 +1,12 @@ #!/bin/sh -echo "Installing mdbook-linkcheck" - -_version="v0.7.0" -curl -sL -o ~/bin/linkcheck.tar.gz "https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/${_version}/mdbook-linkcheck-${_version}-x86_64-unknown-linux-gnu.tar.gz" - -tar xvf ~/bin/linkcheck.tar.gz -C ~/bin +# Fetch upstream +git fetch git://github.com/void-linux/void-docs.git master echo "Checking links" - -RUST_LOG=linkcheck=debug ~/bin/mdbook-linkcheck -s +RUST_LOG=linkcheck=debug mdbook-linkcheck -s LINKCHECK=$? -echo "Installing Go" - -curl -sL -o ~/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme -chmod +x ~/bin/gimme - -eval "$(gimme stable)" - -GO111MODULE=auto go get github.com/bobertlo/vmd/cmd/vmdfmt - -echo "Checking formatting" - -PATH=$PATH:$(go env GOPATH)/bin/ - -if ! command -v git ; then - echo "You need git to run the CI scripts" - exit 1 -fi - -if ! command -v vmdfmt ; then - echo "You need vmdfmt to run the CI scripts" - exit 1 -fi - -# Fetch upstream -git fetch git://github.com/void-linux/void-docs.git master - # Format them printf "Formatting tree" vmdfmt -l -w src/