From 7289c5235823badda4d85d0635caa00e657aebdf Mon Sep 17 00:00:00 2001 From: ichizok Date: Mon, 17 Jan 2022 02:04:11 +0900 Subject: [PATCH 1/3] Always generate code coverage --- .github/workflows/test.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4ab95d..b6efb65 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -87,7 +87,7 @@ jobs: fi - name: Coverage from Python - if: success() && matrix.make_target == 'fast-test' + if: always() && matrix.make_target == 'fast-test' run: | # Coverage from Python (cannot be combined with non-branch data). if [[ -f .coverage_covimerage ]]; then @@ -96,14 +96,14 @@ jobs: fi - name: Codecov for Python - if: success() && matrix.make_target == 'fast-test' + if: matrix.make_target == 'fast-test' uses: codecov/codecov-action@v2 with: files: coverage.xml flags: python - name: Coverage from Vim - if: success() + if: always() run: | # Coverage from Vim. covimerage write_coverage $TEST_PROFILE @@ -111,7 +111,6 @@ jobs: coverage xml - name: Codecov for Vim - if: success() uses: codecov/codecov-action@v2 with: files: coverage.xml From 4b9fda4c48130a0d829049153ebb4b4b8a35eb8d Mon Sep 17 00:00:00 2001 From: ichizok Date: Mon, 10 Apr 2023 19:57:03 +0900 Subject: [PATCH 2/3] Update codecov action to v3 --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b6efb65..a0cb5e0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -97,7 +97,7 @@ jobs: - name: Codecov for Python if: matrix.make_target == 'fast-test' - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: files: coverage.xml flags: python @@ -111,7 +111,7 @@ jobs: coverage xml - name: Codecov for Vim - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: files: coverage.xml flags: vimscript From a67a6809a0b10e181f9298b1092271d22c88be55 Mon Sep 17 00:00:00 2001 From: ichizok Date: Mon, 17 Jan 2022 04:57:22 +0900 Subject: [PATCH 3/3] Fix action to generate js and py since master branch is protected, to update js and py create pull-request and do auto-merging in action. --- .github/workflows/test.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a0cb5e0..521ad35 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -74,16 +74,20 @@ jobs: vim --version make --keep-going $MAKE_TARGET - - name: Commit and push - if: success() && matrix.make_target == 'fast-test' && github.ref_name == 'master' + - name: Generate js and py + if: matrix.make_target == 'fast-test' && github.ref_name == 'master' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | if ! make fast-check; then git config --local user.name 'github-actions[bot]' git config --local user.email 'github-actions[bot]@users.noreply.github.com' - git remote set-url origin 'https://github-actions:${{ github.token }}@github.com/${{ github.repository }}' + git switch -c bot/generate-jspy git add js/vimlparser.js py/vimlparser.py - git commit -m 'generate js and py' - git push origin '${{ github.ref_name }}' + git commit -m 'chore: generate js and py' + git push -u origin "$(git rev-parse --abbrev-ref @)" + gh pr create --base master --title 'chore: generate js and py' --body '' | tee /tmp/pull_request + gh pr merge "$(cat /tmp/pull_request)" --auto --merge --delete-branch fi - name: Coverage from Python