1{ 2 "name": "CI", 3 "on": { 4 "push": { 5 "branches": [ 6 "trunk", 7 "v*.x" 8 ] 9 }, 10 "pull_request": { 11 "branches": [ 12 "trunk", 13 "v*.x" 14 ] 15 } 16 }, 17 "jobs": { 18 "check": { 19 "name": "Check", 20 "runs-on": "ubuntu-latest", 21 "strategy": { 22 "fail-fast": false, 23 "matrix": { 24 "rust": [ 25 "stable", 26 "beta", 27 "nightly", 28 "1.18.0" 29 ] 30 } 31 }, 32 "steps": [ 33 { 34 "uses": "actions/checkout@v2", 35 "name": "Checkout" 36 }, 37 { 38 "uses": "actions-rs/toolchain@v1", 39 "with": { 40 "profile": "minimal", 41 "toolchain": "${{ matrix.rust }}", 42 "override": true 43 }, 44 "name": "Install Rust ${{ matrix.rust }}" 45 }, 46 { 47 "uses": "actions-rs/cargo@v1", 48 "with": { 49 "command": "check" 50 }, 51 "name": "Run `cargo check`" 52 }, 53 { 54 "uses": "actions-rs/cargo@v1", 55 "with": { 56 "command": "check", 57 "args": "--examples" 58 }, 59 "name": "Check examples", 60 "if": "matrix.rust != '1.18.0'" 61 } 62 ] 63 }, 64 "test": { 65 "name": "Test", 66 "runs-on": "ubuntu-latest", 67 "strategy": { 68 "matrix": { 69 "rust": [ 70 "stable", 71 "beta", 72 "nightly" 73 ] 74 } 75 }, 76 "steps": [ 77 { 78 "uses": "actions/checkout@v2", 79 "name": "Checkout" 80 }, 81 { 82 "uses": "actions-rs/toolchain@v1", 83 "with": { 84 "profile": "minimal", 85 "toolchain": "${{ matrix.rust }}", 86 "override": true 87 }, 88 "name": "Install Rust ${{ matrix.rust }}" 89 }, 90 { 91 "uses": "actions-rs/cargo@v1", 92 "with": { 93 "command": "test" 94 }, 95 "name": "Run `cargo test`" 96 } 97 ] 98 }, 99 "lints": { 100 "name": "Lints", 101 "runs-on": "ubuntu-latest", 102 "steps": [ 103 { 104 "uses": "actions/checkout@v2", 105 "name": "Checkout" 106 }, 107 { 108 "uses": "actions-rs/toolchain@v1", 109 "with": { 110 "profile": "minimal", 111 "toolchain": "stable", 112 "override": true, 113 "components": "rustfmt, clippy" 114 }, 115 "name": "Install Rust stable" 116 }, 117 { 118 "uses": "actions-rs/cargo@v1", 119 "with": { 120 "command": "fmt", 121 "args": "--all -- --check" 122 }, 123 "name": "Run `cargo fmt`" 124 }, 125 { 126 "uses": "actions-rs/cargo@v1", 127 "with": { 128 "command": "clippy", 129 "args": "-- -D warnings" 130 }, 131 "name": "Run `cargo clippy`" 132 } 133 ] 134 }, 135 "coverage": { 136 "name": "Code Coverage", 137 "runs-on": "ubuntu-latest", 138 "steps": [ 139 { 140 "uses": "actions/checkout@v2", 141 "name": "Checkout" 142 }, 143 { 144 "uses": "actions-rs/toolchain@v1", 145 "with": { 146 "profile": "minimal", 147 "toolchain": "nightly", 148 "override": true 149 }, 150 "name": "Install Rust nightly" 151 }, 152 { 153 "name": "Run cargo-tarpaulin", 154 "uses": "actions-rs/tarpaulin@v0.1", 155 "with": { 156 "version": "0.12.3", 157 "args": "--ignore-tests -- --test-threads 1" 158 } 159 }, 160 { 161 "name": "Upload to codecov.io", 162 "uses": "codecov/codecov-action@v1" 163 }, 164 { 165 "name": "Archive code coverage results", 166 "uses": "actions/upload-artifact@v1", 167 "with": { 168 "name": "code-coverage-report", 169 "path": "cobertura.xml" 170 } 171 } 172 ] 173 } 174 } 175} 176