-
Notifications
You must be signed in to change notification settings - Fork 34
146 lines (140 loc) · 4.36 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: CI
on:
pull_request:
push:
branches:
- "*"
tags:
- "*"
jobs:
build:
name: Test
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup | Cache Cargo
uses: actions/[email protected]
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ubuntu-test-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Test
run: |
cargo install cargo-machete
cargo machete
cargo clippy
cargo test
- name: Lint output
run: make test:lint
- name: Init test
run: make test:init
- name: Lint output JSON
run: make test:lint-json
test_node:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: Test for Node.js
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Setup | Cache Cargo
uses: actions/[email protected]
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
${{ steps.yarn-cache-dir-path.outputs.dir }}
target/
key: ubuntu-test-cargo-yarn-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/setup-node@v3
with:
node-version: 21
registry-url: "https://registry.npmjs.org"
- name: Test Node.js
run: |
make test:node
test_python:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: Test for Python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup | Cache Cargo
uses: actions/[email protected]
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cache/pip
target/
key: ubuntu-test-cargo-python-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install pytest
run: python3 -m pip install pytest
- name: Test Python
run: make test:python
test_ruby:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: Test for Ruby
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup | Cache Cargo
uses: actions/[email protected]
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ubuntu-test-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- name: Test Ruby
run: make test:ruby
test_java:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
fail-fast: true
matrix:
settings:
- host: ubuntu-latest
- host: macos-latest
runs-on: ${{ matrix.settings.host }}
name: Test for Java on ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v3
- name: Setup | Cache Cargo
uses: actions/[email protected]
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.m2/repository
target/
key: ${{ matrix.settings.host }}-cargo-maven-${{ hashFiles('**/Cargo.lock') }}
- name: Install JDK
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "temurin"
- name: Test Java
run: make test:java