-
-
Notifications
You must be signed in to change notification settings - Fork 6
130 lines (130 loc) · 4.28 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_NET_RETRY: 3
CARGO_TERM_COLOR: always
jobs:
commits:
name: Commits
if: ${{ github.ref != 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
typecheck:
name: Type check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: stevearc/nvim-typecheck-action@v2
with:
path: lua
configpath: ".luarc.json"
selene:
name: Selene
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: cargo-bins/cargo-binstall@main
- name: Selene
run: |
cargo binstall --no-confirm selene
selene --config selene.toml ./lua
code_format:
name: Code Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --config-path .stylua.toml ./lua
- name: Auto commit
if: ${{ github.ref != 'refs/heads/main' }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore(pr): auto-commit"
ubuntu_installer:
name: Ubuntu Installer
runs-on: ubuntu-latest
steps:
- uses: Swatinem/rust-cache@v2
- uses: mozilla-actions/sccache-action@v0.0.7
- name: Get branch
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Install lin.nvim
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
run: |
set -x
echo '${{ steps.extract_branch.outputs.branch }}'
export BRANCH_NAME=${{ steps.extract_branch.outputs.branch }}
git clone --single-branch --branch $BRANCH_NAME --depth=1 /~https://github.com/linrongbin16/lin.nvim ~/.nvim && cd ~/.nvim && bash -euxo pipefail ./install
macos_installer:
name: MacOS Installer
runs-on: macos-latest
steps:
- uses: Homebrew/actions/setup-homebrew@master
- uses: Swatinem/rust-cache@v2
- uses: mozilla-actions/sccache-action@v0.0.7
- name: Get branch
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Install lin.nvim
shell: bash
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
run: |
set -x
echo '${{ steps.extract_branch.outputs.branch }}'
echo ${{ steps.extract_branch.outputs.branch }}
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
git clone --single-branch --branch ${{ steps.extract_branch.outputs.branch }} --depth=1 /~https://github.com/linrongbin16/lin.nvim ~/.nvim && cd ~/.nvim && bash -euxo pipefail ./install
windows_installer:
name: Windows Installer
runs-on: windows-latest
steps:
- uses: ilammy/msvc-dev-cmd@v1
- uses: Swatinem/rust-cache@v2
- uses: mozilla-actions/sccache-action@v0.0.7
- uses: MinoruSekine/setup-scoop@v4.0.1
with:
buckets: extras
- name: Get branch
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
shell: bash
id: extract_branch
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_x86
- name: Install dotfiles
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
run: |
echo '${{ steps.extract_branch.outputs.branch }}'
echo ${{ steps.extract_branch.outputs.branch }}
git clone --single-branch --branch ${{ steps.extract_branch.outputs.branch }} --depth=1 /~https://github.com/linrongbin16/lin.nvim $env:USERPROFILE\.nvim && cd $env:USERPROFILE\.nvim && pwsh .\install.ps1