Merge pull request #3434 from sclu1034/test/github_actions

Fix GitHub Actions
This commit is contained in:
Emmanuel Lepage Vallée 2021-09-11 14:47:10 -07:00 committed by GitHub
commit 2a8c17daea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -146,7 +146,7 @@ if [ "$BRANCH" != "gh-pages" ]; then
COMPARE_LINKS="$COMPARE_LINKS\nComparison against master (gh-pages): https://github.com/awesomeWM/apidoc/compare/gh-pages...${NEW_REV}" COMPARE_LINKS="$COMPARE_LINKS\nComparison against master (gh-pages): https://github.com/awesomeWM/apidoc/compare/gh-pages...${NEW_REV}"
fi fi
# shellcheck disable=SC2028 # shellcheck disable=SC2028
echo "Compare links:\n$COMPARE_LINKS" printf %s "Compare links:\n$COMPARE_LINKS"
# Post a comment to the PR. # Post a comment to the PR.
if [ "$PR_NUMBER" != false ]; then if [ "$PR_NUMBER" != false ]; then

View File

@ -324,7 +324,7 @@ jobs:
luacov-coveralls \ luacov-coveralls \
--verbose \ --verbose \
--merge \ --merge \
--repo-token ${{ secrets.COVERALLS_REPO_TOKEN }} \ --repo-token ${{ secrets.COVERALLS_REPO_TOKEN || github.token }} \
--service-name "" --service-name ""
# `check-qa` is the only test that doesn't get a coverage report, so it has to run after all of that. # `check-qa` is the only test that doesn't get a coverage report, so it has to run after all of that.
@ -336,12 +336,13 @@ jobs:
- name: Test previous commits - name: Test previous commits
if: matrix.test_prev_commits && github.event_name == 'pull_request' if: matrix.test_prev_commits && github.event_name == 'pull_request'
run: | run: |
git remote add fork "${{ github.event.pull_request.head.repo.git_url }}"
# `actions/checkout` creates a shallow repo (`--depth 1`) by default, # `actions/checkout` creates a shallow repo (`--depth 1`) by default,
# which is fine for everything up until now. But we need individual commits now. # which is fine for everything up until now. But we need individual commits now.
# And we only want to unshallow now, to not slow down the checkout for other jobs. # And we only want to unshallow now, to not slow down the checkout for other jobs.
git fetch --unshallow git fetch --unshallow --all
rev_list="$(git rev-list --bisect-all origin/${{ github.base_ref }}..origin/${{ github.head_ref }})" rev_list="$(git rev-list --bisect-all origin/${{ github.base_ref }}..fork/${{ github.head_ref }})"
commits="$(echo "$rev_list" | grep -v 'dist=0' | cut -d' ' -f 1)" commits="$(echo "$rev_list" | grep -v 'dist=0' | cut -d' ' -f 1)"
n="$(echo "$commits" | wc -l)" n="$(echo "$commits" | wc -l)"