Skip to content

Test dotfiles

Test dotfiles #1376

Workflow file for this run

name: Test dotfiles
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
- build/*
pull_request:
branches:
- master
schedule:
- cron: 41 11 * * 0
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
severity: style
# Prevent SC1090/SC1091. Will fail if we have too many scripts.
# Check usage of "-x" or "external-sources=true" then.
check_together: 'yes'
ignore_paths: nvim/tests/test-efm
env:
SHELLCHECK_OPTS: -s bash
build:
timeout-minutes: 20
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-11]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
path: '.dotfiles'
fetch-depth: 40
- run: |
cd .dotfiles/
git config --global user.email "[email protected]"
git config --global user.name "git-perf"
- name: Install and test
env:
VERSION_RUNNER_OS: ${{ matrix.os }}
shell: bash
run: |
env
export XDG_CONFIG_HOME=~/.config
# Don't care about outdated, broken linkages on CI.
# Otherwise, this might update node or php.
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
export HOMEBREW_NO_INSTALL_CLEANUP=1
# Make `infocmp` for nvim healthcheck succeed
export TERM=dumb
cd .dotfiles/
./script/ci.sh
- name: Rename versions report
if: always()
run: |
cd .dotfiles/
mv versions.txt versions-${{matrix.os}}.txt
- name: Archive version report
uses: actions/upload-artifact@v3
if: always()
with:
name: versions-report-${{matrix.os}}
path: .dotfiles/versions-*.txt
if-no-files-found: error
report:
needs: build
concurrency: gh-pages-concurrency # keep_files==True uses last writer wins
if: always()
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 40
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: use commit name as report name
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "REPORT_NAME=${{github.sha}}" >> $GITHUB_ENV
- name: use branch name as report name
if: ${{ github.event_name == 'push' }}
run: |
echo "REPORT_NAME=${GITHUB_REF_SLUG}" >> $GITHUB_ENV
- name: report
shell: bash
run: |
export PATH=~/.local/bin:$PATH
python3 -m pip install git+https://github.com/kaihowl/git-perf.git@latest
git perf pull
mkdir reports/
git perf report -n 40 -o reports/${{env.REPORT_NAME}}.html -s os
- name: Publish new perf reports
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./reports
keep_files: true
- uses: actions/github-script@v6
if: github.event_name == 'pull_request'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { REPORT_NAME } = process.env
const pages = await github.rest.repos.getPages({
owner: context.repo.owner,
repo: context.repo.repo,
})
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `⏱ [Performance Results](${pages.data.html_url}/${REPORT_NAME}.html)`
})