forked from bergercookie/asm-lsp
-
Notifications
You must be signed in to change notification settings - Fork 1
141 lines (112 loc) · 4.06 KB
/
lint_and_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
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
name: Lint Code / Run Tests
on:
workflow_call:
workflow_dispatch:
push:
branches:
- "*"
pull_request:
branches: ["master"]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
tests:
name: Run Unit Tests
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.rust == 'nightly' }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [stable, beta, nightly]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: rustup toolchain install ${{ matrix.rust }} --profile minimal
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v3
- name: Set up Ruby on Windows
if: runner.os == 'Windows'
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
msys2: true
- name: Install Ruby on Ubuntu
if: runner.os == 'Linux'
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.6'
- name: Setup Ruby on Ubuntu
if: runner.os == 'Linux'
run: sudo ln -s "$(which ruby)" /usr/bin/ruby3.2
# Install Strawberry Perl
- name: Install Strawberry Perl
if: runner.os == 'Windows'
run: choco install strawberryperl --version=5.32.1.1
# Set Perl environment to Strawberry Perl
- name: Set Perl environment to Strawberry Perl
if: runner.os == 'Windows'
run: echo "PERL=C:/Strawberry/perl/bin/perl.exe" | Out-File -FilePath $env:GITHUB_ENV -Append
# Install MSYS2 and MinGW on Windows
- name: Install MSYS2 and MinGW on Windows
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
update: true
install: >
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-gcc
mingw-w64-x86_64-openssl
base-devel
path-type: inherit
- name: Set MinGW environment for OpenSSL build
if: runner.os == 'Windows'
run: |
echo "C:/msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
echo "CC=/mingw64/bin/gcc" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "CXX=/mingw64/bin/g++" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Install OpenSSL via vcpkg
if: runner.os == 'Windows'
run: vcpkg install openssl:x64-windows-static-md
- name: Install pre-commit dependencies
run: python -m pip install pre-commit
- uses: pre-commit/[email protected]
name: Run pre-commit hooks
- name: Run Rust tests
run: cargo test
typescript:
name: TypeScript
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
if: needs.changes.outputs.typescript == 'true'
- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version: 18
if: needs.changes.outputs.typescript == 'true'
- run: npm ci
working-directory: ./editors/code
if: needs.changes.outputs.typescript == 'true'
# If this steps fails, your code's type integrity might be wrong at some places at TypeScript level.
- run: npm run typecheck
working-directory: ./editors/code
if: needs.changes.outputs.typescript == 'true'
# You may fix the code automatically by running `npm run lint:fix` if this steps fails.
- run: npm run lint:check
working-directory: ./editors/code
if: needs.changes.outputs.typescript == 'true'
# To fix this steps, please run `npm run format`.
- run: npm run format:check
working-directory: ./editors/code
if: needs.changes.outputs.typescript == 'true'
- run: npm run package --scripts-prepend-node-path
working-directory: ./editors/code
if: needs.changes.outputs.typescript == 'true'