action_core/
summary.rs

1pub const ENV_VAR: &str = "GITHUB_STEP_SUMMARY";
2pub const DOCS_URL: &str = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";
3
4#[derive(Debug, PartialEq, Eq, Hash, Clone)]
5pub struct TableCell {
6    /// Cell content
7    pub data: String,
8    /// Render cell as header
9    pub header: bool,
10    /// Number of columns the cell extends
11    pub colspan: usize,
12    /// Number of rows the cell extends
13    pub rowspan: usize,
14}
15
16impl TableCell {
17    #[must_use]
18    pub fn new(data: String) -> Self {
19        Self {
20            data,
21            ..Self::default()
22        }
23    }
24
25    #[must_use]
26    pub fn header(data: String) -> Self {
27        Self {
28            data,
29            header: true,
30            ..Self::default()
31        }
32    }
33}
34
35impl Default for TableCell {
36    fn default() -> Self {
37        Self {
38            data: String::new(),
39            header: false,
40            colspan: 1,
41            rowspan: 1,
42        }
43    }
44}
45
46#[derive(Default, Debug, PartialEq, Eq, Hash, Clone)]
47pub struct ImageOptions {
48    /// The width of the image in pixels.
49    width: Option<usize>,
50
51    /// The height of the image in pixels.
52    height: Option<usize>,
53}
54
55// todo: finish porting the summary stuff
56// finish the proc macro, and test it!
57// continue with the cache stuff?