From dbba46b349c6ede3ecc4965346f6028a467492f8 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 19 Jul 2021 13:26:36 +0300 Subject: [PATCH] ci: fix yamllint warnings/errors --- .github/workflows/docs_ci.yml | 14 ++++----- .github/workflows/gen_vc.yml | 50 +++++++++++++++++-------------- .github/workflows/module_docs.yml | 17 ++++++----- 3 files changed, 43 insertions(+), 38 deletions(-) diff --git a/.github/workflows/docs_ci.yml b/.github/workflows/docs_ci.yml index a6251594e0..6771051aaa 100644 --- a/.github/workflows/docs_ci.yml +++ b/.github/workflows/docs_ci.yml @@ -9,10 +9,10 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 5 steps: - - uses: actions/checkout@v2 - - name: Build V - run: make - - name: Check markdown line length & code examples - run: ./v check-md -hide-warnings . - ## NB: -hide-warnings is used here, so that the output is less noisy, - ## thus real errors are easier to spot. + - uses: actions/checkout@v2 + - name: Build V + run: make + - name: Check markdown line length & code examples + run: ./v check-md -hide-warnings . + ## NB: -hide-warnings is used here, so that the output is less noisy, + ## thus real errors are easier to spot. diff --git a/.github/workflows/gen_vc.yml b/.github/workflows/gen_vc.yml index 406b0e55b7..73eec94d6f 100644 --- a/.github/workflows/gen_vc.yml +++ b/.github/workflows/gen_vc.yml @@ -10,35 +10,39 @@ on: jobs: build-vc: runs-on: ubuntu-latest + env: + VREPO: github.com/vlang/vc.git steps: - - uses: actions/checkout@v2 - - name: Build V - run: make - - name: Regenerate v.c and v_win.c - run: | - git config --global user.email "vlang-bot@users.noreply.github.com" - git config --global user.name "vlang-bot" + - uses: actions/checkout@v2 + - name: Build V + run: make + - name: Regenerate v.c and v_win.c + run: | + git config --global user.email "vlang-bot@users.noreply.github.com" + git config --global user.name "vlang-bot" - COMMIT_HASH=$(git rev-parse --short HEAD) - COMMIT_MSG=$(git log -1 --oneline --pretty='%s' HEAD) + COMMIT_HASH=$(git rev-parse --short HEAD) + COMMIT_MSG=$(git log -1 --oneline --pretty='%s' HEAD) - rm -rf vc - git clone --depth=1 https://vlang-bot:${{ secrets.VLANG_BOT_SECRET }}@github.com/vlang/vc.git + rm -rf vc + git clone --depth=1 \ + https://vlang-bot:${{ secrets.VLANG_BOT_SECRET }}@$VREPO - rm -rf vc/v.c vc/v_win.c + rm -rf vc/v.c vc/v_win.c - ./v -o vc/v.c -os cross cmd/v - ./v -o vc/v_win.c -os windows cmd/v + ./v -o vc/v.c -os cross cmd/v + ./v -o vc/v_win.c -os windows cmd/v - sed -i "1s/^/#define V_COMMIT_HASH \"$COMMIT_HASH\"\n/" vc/v.c - sed -i "1s/^/#define V_COMMIT_HASH \"$COMMIT_HASH\"\n/" vc/v_win.c + sed -i "1s/^/#define V_COMMIT_HASH \"$COMMIT_HASH\"\n/" vc/v.c + sed -i "1s/^/#define V_COMMIT_HASH \"$COMMIT_HASH\"\n/" vc/v_win.c - # ensure the C files are over 5000 lines long, as a safety measure - [ $(wc -l < vc/v.c) -gt 5000 ] - [ $(wc -l < vc/v_win.c) -gt 5000 ] + # ensure the C files are over 5000 lines long, as a safety measure + [ $(wc -l < vc/v.c) -gt 5000 ] + [ $(wc -l < vc/v_win.c) -gt 5000 ] - git -C vc add v.c v_win.c - git -C vc commit -m "[v:master] $COMMIT_HASH - $COMMIT_MSG" + git -C vc add v.c v_win.c + git -C vc commit -m "[v:master] $COMMIT_HASH - $COMMIT_MSG" - git -C vc pull --rebase origin master # in case there are recent commits - git -C vc push + # in case there are recent commits: + git -C vc pull --rebase origin master + git -C vc push diff --git a/.github/workflows/module_docs.yml b/.github/workflows/module_docs.yml index f1bb0c7e02..7cbb53a474 100644 --- a/.github/workflows/module_docs.yml +++ b/.github/workflows/module_docs.yml @@ -10,11 +10,12 @@ jobs: build-module-docs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 - - name: Build V - run: make - - name: Build module documentation - run: ./v doc -m -f html vlib/ - - name: Deploy docs to vercel - if: ${{ github.event_name == 'push' }} - run: npx vercel --confirm --prod --name vmodules --token ${{ secrets.VERCEL_TOKEN }} vlib/_docs/ || true + - uses: actions/checkout@v2 + - name: Build V + run: make + - name: Build module documentation + run: ./v doc -m -f html vlib/ + - name: Deploy docs to vercel + if: ${{ github.event_name == 'push' }} + run: npx vercel --confirm --prod --name vmodules \ + --token ${{ secrets.VERCEL_TOKEN }} vlib/_docs/ || true