-
Notifications
You must be signed in to change notification settings - Fork 1.2k
81 lines (76 loc) · 2.45 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
name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
runs-on: 'ubuntu-latest'
steps:
- name: 'Get Changed Files'
id: 'files'
uses: 'masesgroup/retrieve-changed-files@v2'
with:
format: 'json'
# a force push will cause the action above to fail. Don't do force push when people are
# reviewing!
- name: Check out code.
uses: actions/checkout@v3
- uses: 'actions/setup-go@v4'
with:
go-version: '1.20'
- name: 'Check EditorConfig Lint'
run: |
sudo apt install -y jq
go install 'github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@latest'
readarray -t changed_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.added_modified }}')"
~/go/bin/editorconfig-checker ${changed_files[@]}
typo:
runs-on: ubuntu-latest
steps:
- name: Check out code.
uses: actions/checkout@v3
- name: spell check
run: |
pip install codespell==2.2
git grep --cached -l '' | grep -v -e 'History\.md' -e 'AUTHORS' -e 'man/.*\.1' -e 'man/.*\.html' | xargs codespell --ignore-words=.github/.ignore_words
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest==7.4.0 GitPython==3.1.40 testpath==0.6.0
- name: Unit test
run: make test
build:
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.platform }}
steps:
- name: Check out code.
uses: actions/checkout@v3
- name: Linux Install
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get install -y bsdmainutils
- name: Script
run: |
./check_integrity.sh $(find bin | cut -b 5- | xargs)
- name: Brew release
if: matrix.platform == 'macos-latest'
run: |
mkdir ../release && git archive --format=tar.gz HEAD > ../release/git-extras-release.tar.gz
cd ../release
tar -xzf git-extras-release.tar.gz && make PREFIX=$(pwd) INSTALL_VIA=brew
./bin/git-extras update | grep "brew upgrade git-extras"