forked from tamasfe/taplo
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (126 loc) · 3.79 KB
/
ci.yaml
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
name: Continuous integration
on:
push:
branches:
- master
tags:
- release-*
paths-ignore:
- "site/**/*"
- schemas/**/*
- util/**/*
workflow_dispatch: {}
pull_request:
branches:
- master
jobs:
auto_tag:
name: Tag Releases
if: (github.event_name == 'push' && github.ref_type == 'branch') || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.WORKFLOW_PAT }}
fetch-depth: 0
- uses: tamasfe/auto-tag@v5
with:
name: tamasfe
email: [email protected]
token: ${{ secrets.WORKFLOW_PAT }}
fmt:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker://docker.io/tamasfe/taplo:latest
with:
args: fmt --check --diff
test:
name: Test on Rust stable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install latest Rust toolchain
run: rustup update --no-self-update
- uses: Swatinem/rust-cache@v2
- name: Test Taplo
run: cargo test -p taplo
- name: Check formatting regression
run: cargo run -- fmt --check
- name: Check if git index is clean
run: git diff-index --quiet HEAD --
check_wasm32:
name: Check on WASM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install latest Rust toolchain
run: |
rustup update --no-self-update
rustup target add wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- working-directory: crates/taplo-wasm
run: cargo check --target wasm32-unknown-unknown
toml_test:
name: Run toml-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install latest Rust toolchain
run: |
rustup update --no-self-update
- uses: Swatinem/rust-cache@v2
- name: Retrieve toml-test
run: |
wget https://github.com/BurntSushi/toml-test/releases/download/v1.1.0/toml-test-v1.1.0-linux-amd64.gz
gunzip toml-test-v1.1.0-linux-amd64.gz
chmod +x toml-test-v1.1.0-linux-amd64
- name: Build taplo-cli
run: |
cargo build --bin taplo --no-default-features --features "rustls-tls,toml-test"
- name: Run toml-test
run: ./toml-test-v1.1.0-linux-amd64 ./target/debug/taplo -- toml-test
test-msrv-lib:
name: Test libraries with MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install latest Rust toolchain
run: |
rustup update --no-self-update
rustup default 1.70
- uses: Swatinem/rust-cache@v2
- name: Test MSRV for taplo
run: |
cargo check -p lsp-async-stub -p taplo-common -p taplo-lsp -p taplo
cargo test -p lsp-async-stub -p taplo-common -p taplo-lsp -p taplo
test-msrv-bin:
name: Test binaries with MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install latest Rust toolchain
run: |
rustup update --no-self-update
rustup default 1.70
- uses: Swatinem/rust-cache@v2
- name: Test taplo-cli
run: |
cargo check -p taplo-cli
cargo test -p taplo-cli
test-msrv-wasm:
name: Test WASM with MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install latest Rust toolchain
run: |
rustup update --no-self-update
rustup default 1.74
rustup target install wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- name: Test taplo-wasm
working-directory: crates/taplo-wasm
run: |
cargo check