on master help sign in
CICD: Build step naming
bc35592David Peter
.github/workflows/CICD.yml+36−17
@@ -27,13 +27,13 @@ jobs:
27 # clippy::match_bool is allowed by default from Rust 1.45.0, see
27 # clippy::match_bool is allowed by default from Rust 1.45.0, see
28 # https://github.com/rust-lang/rust-clippy/commit/e1d13c34b0beaea9a5fbf13687672ef85e779d9f
28 # https://github.com/rust-lang/rust-clippy/commit/e1d13c34b0beaea9a5fbf13687672ef85e779d9f
29 args: --all-targets --all-features -- --allow clippy::match_bool
29 args: --all-targets --all-features -- --allow clippy::match_bool
30− - name: Test
30+ - name: Run tests
31 uses: actions-rs/cargo@v1
31 uses: actions-rs/cargo@v1
32 with:
32 with:
33 command: test
33 command: test
34
34
35 test_with_new_syntaxes_and_themes:
35 test_with_new_syntaxes_and_themes:
36− name: Test with new syntaxes and themes
36+ name: Run tests with updated syntaxes and themes
37 runs-on: ubuntu-18.04
37 runs-on: ubuntu-18.04
38 steps:
38 steps:
39 - name: Git checkout
39 - name: Git checkout
@@ -94,8 +94,9 @@ jobs:
94 - { os: windows-2019 , target: x86_64-pc-windows-gnu }
94 - { os: windows-2019 , target: x86_64-pc-windows-gnu }
95 - { os: windows-2019 , target: x86_64-pc-windows-msvc }
95 - { os: windows-2019 , target: x86_64-pc-windows-msvc }
96 steps:
96 steps:
97− - name: Git checkout
97+ - name: Checkout source code
98 uses: actions/checkout@v2
98 uses: actions/checkout@v2
99+
99 - name: Install prerequisites
100 - name: Install prerequisites
100 shell: bash
101 shell: bash
101 run: |
102 run: |
@@ -103,6 +104,7 @@ jobs:
103 arm-unknown-linux-gnueabihf) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
104 arm-unknown-linux-gnueabihf) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
104 aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
105 aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
105 esac
106 esac
107+
106 - name: Extract crate information
108 - name: Extract crate information
107 shell: bash
109 shell: bash
108 run: |
110 run: |
@@ -110,6 +112,7 @@ jobs:
110 echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
112 echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
111 echo "PROJECT_MAINTAINER=$(sed -n 's/^authors = \["\(.*\)"\]/\1/p' Cargo.toml)" >> $GITHUB_ENV
113 echo "PROJECT_MAINTAINER=$(sed -n 's/^authors = \["\(.*\)"\]/\1/p' Cargo.toml)" >> $GITHUB_ENV
112 echo "PROJECT_HOMEPAGE=$(sed -n 's/^homepage = "\(.*\)"/\1/p' Cargo.toml)" >> $GITHUB_ENV
114 echo "PROJECT_HOMEPAGE=$(sed -n 's/^homepage = "\(.*\)"/\1/p' Cargo.toml)" >> $GITHUB_ENV
115+
113 - name: Install Rust toolchain
116 - name: Install Rust toolchain
114 uses: actions-rs/toolchain@v1
117 uses: actions-rs/toolchain@v1
115 with:
118 with:
@@ -117,7 +120,8 @@ jobs:
117 target: ${{ matrix.job.target }}
120 target: ${{ matrix.job.target }}
118 override: true
121 override: true
119 profile: minimal # minimal component installation (ie, no documentation)
122 profile: minimal # minimal component installation (ie, no documentation)
120− - name: Info
123+
124+ - name: Show version information (Rust, cargo, GCC)
121 shell: bash
125 shell: bash
122 run: |
126 run: |
123 gcc --version || true
127 gcc --version || true
@@ -126,13 +130,15 @@ jobs:
126 rustup default
130 rustup default
127 cargo -V
131 cargo -V
128 rustc -V
132 rustc -V
133+
129 - name: Build
134 - name: Build
130 uses: actions-rs/cargo@v1
135 uses: actions-rs/cargo@v1
131 with:
136 with:
132 use-cross: ${{ matrix.job.use-cross }}
137 use-cross: ${{ matrix.job.use-cross }}
133 command: build
138 command: build
134 args: --release --target=${{ matrix.job.target }}
139 args: --release --target=${{ matrix.job.target }}
135− - name: Strip release bin
140+
141+ - name: Strip debug information from executable
136 id: strip
142 id: strip
137 shell: bash
143 shell: bash
138 run: |
144 run: |
@@ -167,7 +173,8 @@ jobs:
167 # Let subsequent steps know where to find the (stripped) bin
173 # Let subsequent steps know where to find the (stripped) bin
168 echo ::set-output name=BIN_PATH::${BIN_PATH}
174 echo ::set-output name=BIN_PATH::${BIN_PATH}
169 echo ::set-output name=BIN_NAME::${BIN_NAME}
175 echo ::set-output name=BIN_NAME::${BIN_NAME}
176+
170− - name: Calculate test options
177+ - name: Set testing options
171 id: test-options
178 id: test-options
172 shell: bash
179 shell: bash
173 run: |
180 run: |
@@ -175,49 +182,57 @@ jobs:
175 unset CARGO_TEST_OPTIONS
182 unset CARGO_TEST_OPTIONS
176 unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--lib --bin ${PROJECT_NAME}" ;; esac;
183 unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--lib --bin ${PROJECT_NAME}" ;; esac;
177 echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}
184 echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}
185+
178− - name: Test
186+ - name: Run tests
179 uses: actions-rs/cargo@v1
187 uses: actions-rs/cargo@v1
180 with:
188 with:
181 use-cross: ${{ matrix.job.use-cross }}
189 use-cross: ${{ matrix.job.use-cross }}
182 command: test
190 command: test
183 args: --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
191 args: --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
192+
184− - name: bat test run
193+ - name: Run bat
185 uses: actions-rs/cargo@v1
194 uses: actions-rs/cargo@v1
186 with:
195 with:
187 use-cross: ${{ matrix.job.use-cross }}
196 use-cross: ${{ matrix.job.use-cross }}
188 command: run
197 command: run
189 args: --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs
198 args: --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs
199+
190− - name: bat diagnostics output
200+ - name: Show diagnostics (bat --diagnostic)
191 uses: actions-rs/cargo@v1
201 uses: actions-rs/cargo@v1
192 with:
202 with:
193 use-cross: ${{ matrix.job.use-cross }}
203 use-cross: ${{ matrix.job.use-cross }}
194 command: run
204 command: run
195 args: --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs --diagnostic
205 args: --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs --diagnostic
206+
196− - name: Check features regex-onig
207+ - name: "Feature check: regex-onig"
197 uses: actions-rs/cargo@v1
208 uses: actions-rs/cargo@v1
198 with:
209 with:
199 use-cross: ${{ matrix.job.use-cross }}
210 use-cross: ${{ matrix.job.use-cross }}
200 command: check
211 command: check
201 args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig
212 args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig
213+
202− - name: Check features regex-onig,git
214+ - name: "Feature check: regex-onig,git"
203 uses: actions-rs/cargo@v1
215 uses: actions-rs/cargo@v1
204 with:
216 with:
205 use-cross: ${{ matrix.job.use-cross }}
217 use-cross: ${{ matrix.job.use-cross }}
206 command: check
218 command: check
207 args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git
219 args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git
220+
208− - name: Check features regex-onig,paging
221+ - name: "Feature check: regex-onig,paging"
209 uses: actions-rs/cargo@v1
222 uses: actions-rs/cargo@v1
210 with:
223 with:
211 use-cross: ${{ matrix.job.use-cross }}
224 use-cross: ${{ matrix.job.use-cross }}
212 command: check
225 command: check
213 args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,paging
226 args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,paging
227+
214− - name: Check features regex-onig,git,paging
228+ - name: "Feature check: regex-onig,git,paging"
215 uses: actions-rs/cargo@v1
229 uses: actions-rs/cargo@v1
216 with:
230 with:
217 use-cross: ${{ matrix.job.use-cross }}
231 use-cross: ${{ matrix.job.use-cross }}
218 command: check
232 command: check
219 args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git,paging
233 args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git,paging
220− - name: Package
234+
235+ - name: Create tarball
221 id: package
236 id: package
222 shell: bash
237 shell: bash
223 run: |
238 run: |
@@ -254,7 +269,8 @@ jobs:
254
269
255 # Let subsequent steps know where to find the compressed package
270 # Let subsequent steps know where to find the compressed package
256 echo ::set-output name=PKG_PATH::"${PKG_STAGING}/${PKG_NAME}"
271 echo ::set-output name=PKG_PATH::"${PKG_STAGING}/${PKG_NAME}"
272+
257− - name: Debian package
273+ - name: Create Debian package
258 id: debian-package
274 id: debian-package
259 shell: bash
275 shell: bash
260 if: startsWith(matrix.job.os, 'ubuntu')
276 if: startsWith(matrix.job.os, 'ubuntu')
@@ -362,23 +378,26 @@ jobs:
362 # build dpkg
378 # build dpkg
363 fakeroot dpkg-deb --build "${DPKG_DIR}" "${DPKG_PATH}"
379 fakeroot dpkg-deb --build "${DPKG_DIR}" "${DPKG_PATH}"
364
380
365− - name: Upload package artifact
381+ - name: "Artifact upload: tarball"
366 uses: actions/upload-artifact@master
382 uses: actions/upload-artifact@master
367 with:
383 with:
368 name: ${{ steps.package.outputs.PKG_NAME }}
384 name: ${{ steps.package.outputs.PKG_NAME }}
369 path: ${{ steps.package.outputs.PKG_PATH }}
385 path: ${{ steps.package.outputs.PKG_PATH }}
386+
370− - name: Upload Debian package artifact
387+ - name: "Artifact upload: Debian package"
371 uses: actions/upload-artifact@master
388 uses: actions/upload-artifact@master
372 if: steps.debian-package.outputs.DPKG_NAME
389 if: steps.debian-package.outputs.DPKG_NAME
373 with:
390 with:
374 name: ${{ steps.debian-package.outputs.DPKG_NAME }}
391 name: ${{ steps.debian-package.outputs.DPKG_NAME }}
375 path: ${{ steps.debian-package.outputs.DPKG_PATH }}
392 path: ${{ steps.debian-package.outputs.DPKG_PATH }}
393+
376 - name: Check for release
394 - name: Check for release
377 id: is-release
395 id: is-release
378 shell: bash
396 shell: bash
379 run: |
397 run: |
380 unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
398 unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
381 echo ::set-output name=IS_RELEASE::${IS_RELEASE}
399 echo ::set-output name=IS_RELEASE::${IS_RELEASE}
400+
382 - name: Publish archives and packages
401 - name: Publish archives and packages
383 uses: softprops/action-gh-release@v1
402 uses: softprops/action-gh-release@v1
384 if: steps.is-release.outputs.IS_RELEASE
403 if: steps.is-release.outputs.IS_RELEASE