Skip to content
This repository was archived by the owner on Dec 26, 2024. It is now read-only.

Commit

Permalink
Reenable CI
Browse files Browse the repository at this point in the history
  • Loading branch information
BinderDavid committed May 12, 2024
1 parent 542320a commit 9287319
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 102 deletions.
141 changes: 42 additions & 99 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,113 +1,56 @@
name: ci
name: Rust CI

on:
push:
branches:
- master

- main
pull_request:
branches:
- master
types:
- opened
- synchronize

permissions:
contents: read
statuses: write

env:
CARGO_TERM_COLOR: always

jobs:
check:
runs-on: ubuntu-20.04
strategy:
matrix:
rust: ["1.46.0", "stable", "beta", "nightly"]
name: Check (${{ matrix.rust }})
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install minimal ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
# Check each crate individually to work around rust-lang/cargo#4942
- name: Run cargo check for codespan-reporting
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path "codespan-reporting/Cargo.toml" --features "serialization"
- name: Run cargo check for codespan
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path "codespan/Cargo.toml" --features "serialization"
- name: Run cargo check for codespan-lsp
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path "codespan-lsp/Cargo.toml"
- name: Switch to minimal lsp-types version for codespan-lsp
uses: actions-rs/cargo@v1
with:
command: update
# NOTE: Keep up to date with the minimum version of `lsp-types`
# specified in `codespan-lsp/Cargo.toml`
args: --precise 0.84.0 -p lsp-types
- name: Run cargo test for codespan-lsp
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path "codespan-lsp/Cargo.toml"
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check --all

test:
runs-on: ubuntu-20.04
strategy:
matrix:
rust: ["1.46.0", "stable", "beta", "nightly"]
name: Test Suite (${{ matrix.rust }})
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install minimal ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
# Test each crate individually to work around rust-lang/cargo#4942
- name: Run cargo test for codespan-reporting
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path "codespan-reporting/Cargo.toml" --features "serialization"
- name: Run cargo test for codespan
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path "codespan/Cargo.toml" --features "serialization"
- name: Switch to minimal lsp-types version for codespan-lsp
uses: actions-rs/cargo@v1
with:
command: update
# NOTE: Keep up to date with the minimum version of `lsp-types`
# specified in `codespan-lsp/Cargo.toml`
args: --precise 0.84.0 lsp-types
- name: Run cargo test for codespan-lsp
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path "codespan-lsp/Cargo.toml"
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --all

fmt:
runs-on: ubuntu-20.04
strategy:
matrix:
rust: ["1.46.0", "stable", "beta", "nightly"]
name: Rustfmt (${{ matrix.rust }})
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: rustup component add rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install minimal ${{ matrix.rust }} with rustfmt
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: rustup component add clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all -- -D warnings
1 change: 0 additions & 1 deletion src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,5 +416,4 @@ mod test {

assert_eq!(line_sources, ["foo\n", "bar\r\n", "\n", "baz"],);
}

}
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
#![forbid(unsafe_code)]

mod file;
pub mod lsp_utils;
pub mod files;
mod index;
mod location;
pub mod lsp_utils;
mod span;

pub use crate::file::{FileId, Files, File};
pub use crate::file::{File, FileId, Files};
pub use crate::index::{ByteIndex, ByteOffset};
pub use crate::index::{ColumnIndex, ColumnNumber, ColumnOffset};
pub use crate::index::{Index, Offset};
Expand Down

0 comments on commit 9287319

Please sign in to comment.