forked from wearerequired/lint-action
-
Notifications
You must be signed in to change notification settings - Fork 1
111 lines (88 loc) · 2.59 KB
/
test.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
name: Test
on:
- push
- pull_request
jobs:
test:
name: Run tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
# Go
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13
# TODO: Remove step once actions/setup-go adds $GOPATH/bin to $PATH by default
# See https://github.com/actions/setup-go/issues/14
- name: Add Go to $PATH
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
echo "::add-path::$(go env GOPATH)/bin"
- name: Install Go dependencies
run: |
cd ./test/linters/projects/golint
go get -u golang.org/x/lint/golint
# Node.js
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install Node.js dependencies
run: |
cd ./test/linters/projects/eslint/
yarn install
cd ../eslint-typescript/
yarn install
cd ../prettier/
yarn install
cd ../stylelint/
yarn install
cd ../xo/
yarn install
# Python
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Python dependencies
run: |
cd ./test/linters/projects/
pip install -r ./black/requirements.txt -r ./flake8/requirements.txt -r ./mypy/requirements.txt
# Ruby
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6
- name: Install Ruby dependencies
run: |
gem install bundler
cd ./test/linters/projects/rubocop/
bundle install
# Swift (only on Linux)
- name: Install Swift dependencies (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
git clone --branch 0.50200.0 --depth 1 git://github.com/apple/swift-format
cd swift-format
swift build -c release
echo "::add-path::${PWD}/.build/release"
# Swift (only on macOS)
- name: Install Swift dependencies (macOS)
if: startsWith(matrix.os, 'macos')
run: |
brew update
brew install mint
cd ./test/linters/projects/swift-format-lockwood/
mint bootstrap --link
cd ../swiftlint/
mint bootstrap --link
# Tests
- name: Run tests
run: |
yarn
yarn test