This repository has been archived by the owner on Mar 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
118 lines (113 loc) · 3.49 KB
/
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
name: "Test & Lint"
on:
push:
# Don't run CI for tags; there's always a branch for the tag as well so
# there's no point in testing it separately
tags_ignore: '*'
pull_request:
jobs:
check-scripts:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Download tools
run: |
curl -fsSL -o ./shfmt https://github.com/mvdan/sh/releases/download/v3.1.2/shfmt_v3.1.2_linux_amd64
chmod 700 ./shfmt
- name: Check formatting
run: ./shfmt -i 4 -l -d scripts/*
- name: Lint scripts
run: shellcheck -S style -o all scripts/*
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: rustfmt --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
manpage:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
- name: install asciidoctor
run: gem install asciidoctor
- name: build manpage
run: asciidoctor -b manpage -a reproducible mdcat.1.adoc
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
target:
# Linux default
- x86_64-unknown-linux-gnu
# For statically linked release builds
- x86_64-unknown-linux-musl
# macOS
- x86_64-apple-darwin
# Windows
- x86_64-pc-windows-msvc
rust: [stable, beta]
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macOS-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
exclude:
# Test beta only with Linux/GNU target, it's just about basic forward
# compatibility after all.
- target: x86_64-unknown-linux-musl
rust: beta
- target: x86_64-apple-darwin
rust: beta
- target: x86_64-pc-windows-msvc
rust: beta
steps:
- uses: actions/checkout@v2
# Install musl tools for musl target
- name: Install musl tools
run: sudo apt-get install musl-tools
if: "contains(matrix.target, 'musl')"
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
target: ${{ matrix.target }}
components: clippy
# Build, including tests, to report build failures and measure build time separately from tests
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-targets --locked --target ${{ matrix.target }}
# Lint
- name: Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --locked --target ${{ matrix.target }}
name: clippy-${{ matrix.rust}}-${{ matrix.target }}
# Test
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --target ${{ matrix.target }}
- name: Format sample
uses: actions-rs/cargo@v1
with:
command: run
args: --target ${{ matrix.target }} -- sample/common-mark.md