Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace discontinued actions-rs from CI #311

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 15 additions & 27 deletions .github/workflows/macchina.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ jobs:
checks:
name: ${{ matrix.name }} (${{ matrix.target }})
runs-on: ${{ matrix.os }}
env:
PROGRAM: ${{ matrix.cross && 'cross' || 'cargo' }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -98,48 +100,34 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Bootstrap
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
target: ${{ matrix.target }}
targets: ${{ matrix.target }}

- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross
if: ${{ matrix.cross }}

- name: Formatting
uses: actions-rs/cargo@v1
with:
command: fmt
use-cross: ${{ matrix.cross }}
run: cargo fmt --all -- --check
if: ${{ !matrix.cross }}
continue-on-error: false

- name: Lints
uses: actions-rs/cargo@v1
with:
command: clippy
args: --target=${{ matrix.target }} -- --no-deps -D clippy::all
use-cross: ${{ matrix.cross }}
run: ${{ env.PROGRAM }} clippy --target=${{ matrix.target }} -- --no-deps -D clippy::all
continue-on-error: false

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --target=${{ matrix.target }}
use-cross: ${{ matrix.cross }}
run: ${{ env.PROGRAM }} build --target=${{ matrix.target }}

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --target=${{ matrix.target }}
run: ${{ env.PROGRAM }} test --target=${{ matrix.target }}
if: ${{ !matrix.cross && !contains(matrix.target, 'aarch64') }}

- name: Doctor
uses: actions-rs/cargo@v1
with:
command: run
args: --target=${{ matrix.target }} -- --doctor
use-cross: ${{ matrix.cross }}
run: ${{ env.PROGRAM }} run --target=${{ matrix.target }} -- --doctor
if: ${{ matrix.test }}
4 changes: 2 additions & 2 deletions src/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use crate::Result;
use ansi_to_tui::IntoText;
use colored::Colorize;
use io::Read;
use ratatui::style::{Color, Style};
use ratatui::text::{Line, Span, Text};
use std::fs::File;
use std::io::{self, BufReader};
use std::path::Path;
use ratatui::style::{Color, Style};
use ratatui::text::{Span, Line, Text};

lazy_static! {
static ref BLUE: Style = Style::default().fg(Color::Blue);
Expand Down
4 changes: 2 additions & 2 deletions src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ use crate::data::Readout;
use crate::theme::Theme;
use crate::widgets::readout::ReadoutList;
use atty::Stream;
use std::io;
use std::io::Stdout;
use ratatui::backend::{Backend, CrosstermBackend};
use ratatui::buffer::{Buffer, Cell};
use ratatui::layout::{Margin, Rect};
use ratatui::text::Text;
use ratatui::widgets::{Block, Borders, Paragraph, Widget};
use std::io;
use std::io::Stdout;
use unicode_width::UnicodeWidthStr;

pub fn create_backend() -> CrosstermBackend<Stdout> {
Expand Down
2 changes: 1 addition & 1 deletion src/theme/color.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rand::seq::SliceRandom;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use ratatui::style::Color;
use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone)]
pub enum ColorTypes {
Expand Down
4 changes: 2 additions & 2 deletions src/theme/components.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::theme::borders::Border;
use crate::theme::color::*;
use rand::Rng;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use ratatui::style::Color;
use ratatui::widgets::BorderType;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Palette {
Expand Down