Skip to content

test: make async waits more reliable #2088

test: make async waits more reliable

test: make async waits more reliable #2088

Workflow file for this run

# From
# https://github.com/shortcuts/neovim-plugin-boilerplate/blob/main/.github/workflows/main.yml
name: tests
on:
push:
pull_request:
types: [opened, synchronize]
jobs:
lint:
runs-on: ubuntu-latest
name: lint
steps:
- uses: actions/checkout@v4
- name: Install StyLua
uses: JohnnyMorganz/stylua-action@v4
with:
version: latest
token: ${{ secrets.GITHUB_TOKEN }}
args: 'false'
- name: Check formatting
run: make format-check
typecheck:
runs-on: ubuntu-latest
name: typecheck
steps:
- uses: actions/checkout@v4
- name: setup neovim
id: setup_nvim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: v0.11.4
- name: Add nvim to PATH
run: echo "${{ steps.setup_nvim.outputs.executable }}" >> $GITHUB_PATH
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install emmylua_check
run: cargo install emmylua_check --version 0.25.1 --locked
- name: Run type checks
run: make typecheck ARGS="-f github"
architecture:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
name: architecture check
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Check module imports against layer rules
id: check
env:
BASE_REF: ${{ github.base_ref }}
run: |
set +e
make -s topology-diff ARGS="--from origin/$BASE_REF --to HEAD --check --markdown" > architecture-report.md
echo "status=$?" >> "$GITHUB_OUTPUT"
cat architecture-report.md >> "$GITHUB_STEP_SUMMARY"
# Fork PRs get a read-only token; the job summary still carries the report.
- name: Post report on the pull request
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.pull_request.number }}
run: |
[ -s architecture-report.md ] || exit 0
marker='<!-- architecture-check-report -->'
id=$(gh api "repos/$GITHUB_REPOSITORY/issues/$PR/comments" --paginate \
--jq ".[] | select(.body | startswith(\"$marker\")) | .id" | head -n1)
if [ -n "$id" ]; then
gh api -X PATCH "repos/$GITHUB_REPOSITORY/issues/comments/$id" -F body=@architecture-report.md
else
gh api "repos/$GITHUB_REPOSITORY/issues/$PR/comments" -F body=@architecture-report.md
fi
- name: Fail on new problems
if: steps.check.outputs.status != '0'
run: exit 1
test:
timeout-minutes: 4
strategy:
matrix:
os: [ubuntu-latest]
neovim_version: ["v0.10.3", "v0.11.4", "nightly"]
include:
- os: macos-latest
neovim_version: v0.11.4
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: setup neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.neovim_version }}
# only needed if testing in ssh but doesn't hurt
- name: Add nvim to PATH
run: echo "${{ steps.setup_nvim.outputs.executable }}" >> $GITHUB_PATH
- name: Run tests
run: make test
# # For sshing in to debug GH actions
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# detached: true