2019-11-21 01:07:59 +00:00
name : CICD
2019-11-30 21:27:21 +00:00
# spell-checker:ignore CICD CODECOV MSVC MacOS Peltoche SHAs buildable clippy dpkg esac fakeroot gnueabihf halium libssl mkdir musl popd printf pushd rustfmt softprops toolchain
2019-11-21 01:07:59 +00:00
env :
PROJECT_NAME : lsd
2019-11-30 21:27:21 +00:00
PROJECT_DESC : "An ls command with a lot of pretty colors."
PROJECT_AUTH : "Peltoche <peltoche@halium.fr>"
update various dependencies (#938)
I'm the maintainer of lsd for Fedora Linux, and some outdated
dependencies are making maintenance increasingly difficult.
- deps: update chrono-humanize to v0.2
We have this patched for almost two years in Fedora and it has not
caused issues.
- deps: update assert_cmd to v2
Same here, this patch has been in the Fedora package for a while.
- deps: update sys-locale to v0.3
This dependency seems to have been added recently, not sure why an old
version was chosen.
- deps: update vsort to v0.2
Same here, this was added recently but 0.1 was used instead of 0.2, not
sure why.
- deps: update git2 to v0.18
Using old versions of git2 is not a good idea, since the bundled libgit2
C library often has CVE issues.
- deps: migrate from users to uzers
The "users" crate is unmaintained. The "uzers" crate is an
API-compatible fork that also fixes some bugs and security issues.
- deps: update serial_test to v2
The current dependency (v0.5) is **reeeeeally** old. Not sure why this
was never updated.
- deps: update predicates to v3
Same here, predicates v1 is **reaally** old.
- deps: allow newer versions of url, wild, and xdg crates
Not sure why strange `x.0.*` style dependencies were used here. It's
holding back various updates for both url and xdg crates, and makes
maintaining lsd in Fedora more difficult. We have built lsd against the
latest versions of all three crates forever, and it has not caused
issues.
2023-12-20 03:44:20 +00:00
RUST_MIN_SRV : "1.70.0"
2019-11-21 01:07:59 +00:00
on : [ push, pull_request]
jobs :
2019-11-21 02:04:54 +00:00
style :
name : Style
2019-12-08 20:09:02 +00:00
runs-on : ${{ matrix.job.os }}
2019-11-21 02:04:54 +00:00
strategy :
fail-fast : false
matrix :
2019-12-08 20:09:02 +00:00
job : [ { os : ubuntu-latest }, { os: macos-latest }, { os: windows-latest } ]
2019-11-21 02:04:54 +00:00
steps :
- uses : actions/checkout@v1
- name : Install `rust` toolchain
uses : actions-rs/toolchain@v1
with :
2020-04-18 08:37:46 +00:00
toolchain : ${{ env.RUST_MIN_SRV }}
2019-11-21 02:04:54 +00:00
override : true
profile : minimal # minimal component installation (ie, no documentation)
components : rustfmt, clippy
- name : "`fmt` testing"
uses : actions-rs/cargo@v1
with :
command : fmt
args : --all -- --check
- name : "`clippy` testing"
2019-12-05 17:35:36 +00:00
if : success() || failure() # run regardless of prior step ("`fmt` testing") success/failure
2019-11-21 02:04:54 +00:00
uses : actions-rs/cargo@v1
with :
command : clippy
2022-08-02 00:44:52 +00:00
args : --tests -- -D warnings
2023-01-12 05:38:38 +00:00
- name : "`clap` deprecated checks"
if : success() || failure() # run regardless of prior step ("`fmt` testing") success/failure
uses : actions-rs/cargo@v1
with :
command : check
args : --features clap/deprecated
2019-11-21 02:04:54 +00:00
2019-12-02 02:15:51 +00:00
min_version :
name : MinSRV # Minimum supported rust version
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v1
- name : Install `rust` toolchain (v${{ env.RUST_MIN_SRV }})
uses : actions-rs/toolchain@v1
with :
toolchain : ${{ env.RUST_MIN_SRV }}
profile : minimal # minimal component installation (ie, no documentation)
- name : Test
uses : actions-rs/cargo@v1
with :
command : test
2019-11-24 23:41:45 +00:00
build :
name : Build
2019-12-08 20:09:02 +00:00
runs-on : ${{ matrix.job.os }}
2019-11-21 01:07:59 +00:00
strategy :
fail-fast : false
matrix :
2019-12-08 20:09:02 +00:00
job :
- { os: ubuntu-latest , target: arm-unknown-linux-gnueabihf , use-cross : use-cross }
2021-02-08 00:07:17 +00:00
- { os: ubuntu-latest , target: aarch64-unknown-linux-gnu , use-cross : use-cross }
- { os: ubuntu-latest , target: aarch64-unknown-linux-musl , use-cross : use-cross }
2019-12-08 20:09:02 +00:00
- { os: ubuntu-latest , target: i686-unknown-linux-gnu , use-cross : use-cross }
- { os: ubuntu-latest , target: i686-unknown-linux-musl , use-cross : use-cross }
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , use-cross : use-cross }
- { os: ubuntu-latest , target: x86_64-unknown-linux-musl , use-cross : use-cross }
- { os: macos-latest , target : x86_64-apple-darwin }
2023-08-19 16:09:16 +00:00
- { os: macos-latest , target : aarch64-apple-darwin }
2019-12-08 20:09:02 +00:00
- { os: windows-latest , target : i686-pc-windows-gnu }
- { os: windows-latest , target : i686-pc-windows-msvc }
- { os: windows-latest , target : x86_64-pc-windows-gnu }
- { os: windows-latest , target : x86_64-pc-windows-msvc }
2019-11-21 01:07:59 +00:00
steps :
- uses : actions/checkout@v1
2019-11-25 05:29:00 +00:00
- name : Install any prerequisites
shell : bash
run : |
2019-12-08 20:09:02 +00:00
case ${{ matrix.job.target }} in
2021-02-08 00:07:17 +00:00
arm-*-linux-*hf) sudo apt-get -y update ; sudo apt-get -y install binutils-arm-linux-gnueabihf ;;
aarch64-*-linux-*) sudo apt-get -y update ; sudo apt-get -y install binutils-aarch64-linux-gnu ;;
2019-11-25 05:29:00 +00:00
esac
2019-11-24 19:32:55 +00:00
- name : Initialize workflow variables
id : vars
2019-11-21 01:07:59 +00:00
shell : bash
run : |
2019-12-02 13:29:56 +00:00
# toolchain
2019-12-08 20:09:02 +00:00
TOOLCHAIN="stable" ## default to "stable" toolchain
# * specify alternate TOOLCHAIN for *-pc-windows-gnu targets; gnu targets on Windows are broken for the standard *-pc-windows-msvc toolchain (refs: <https://github.com/rust-lang/rust/issues/47048>, <https://github.com/rust-lang/rust/issues/53454>, <https://github.com/rust-lang/cargo/issues/6754>)
case ${{ matrix.job.target }} in *-pc-windows-gnu) TOOLCHAIN="stable-${{ matrix.job.target }}" ;; esac;
# * use requested TOOLCHAIN if specified
if [ -n "${{ matrix.job.toolchain }}" ]; then TOOLCHAIN="${{ matrix.job.toolchain }}" ; fi
2019-12-02 13:29:56 +00:00
echo set-output name=TOOLCHAIN::${TOOLCHAIN}
echo ::set-output name=TOOLCHAIN::${TOOLCHAIN}
2019-11-25 00:58:55 +00:00
# staging directory
STAGING='_staging'
echo set-output name=STAGING::${STAGING}
echo ::set-output name=STAGING::${STAGING}
2019-11-24 19:32:55 +00:00
# determine EXE suffix
2019-12-08 20:09:02 +00:00
EXE_suffix="" ; case ${{ matrix.job.target }} in *-pc-windows-*) EXE_suffix=".exe" ;; esac;
2019-11-24 21:22:55 +00:00
echo set-output name=EXE_suffix::${EXE_suffix}
echo ::set-output name=EXE_suffix::${EXE_suffix}
2019-11-24 23:41:45 +00:00
# parse commit reference info
2019-11-22 04:24:37 +00:00
REF_NAME=${GITHUB_REF#refs/*/}
2019-11-24 23:41:45 +00:00
unset REF_BRANCH ; case ${GITHUB_REF} in refs/heads/*) REF_BRANCH=${GITHUB_REF#refs/heads/} ;; esac;
unset REF_TAG ; case ${GITHUB_REF} in refs/tags/*) REF_TAG=${GITHUB_REF#refs/tags/} ;; esac;
2019-11-22 04:24:37 +00:00
REF_SHAS=${GITHUB_SHA:0:8}
2019-11-24 21:22:55 +00:00
echo set-output name=REF_NAME::${REF_NAME}
echo set-output name=REF_BRANCH::${REF_BRANCH}
echo set-output name=REF_TAG::${REF_TAG}
echo set-output name=REF_SHAS::${REF_SHAS}
2019-11-22 04:24:37 +00:00
echo ::set-output name=REF_NAME::${REF_NAME}
echo ::set-output name=REF_BRANCH::${REF_BRANCH}
echo ::set-output name=REF_TAG::${REF_TAG}
echo ::set-output name=REF_SHAS::${REF_SHAS}
2019-11-25 00:58:55 +00:00
# package name
2019-12-08 20:09:02 +00:00
PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac;
PKG_BASENAME=${PROJECT_NAME}-${REF_TAG:-$REF_SHAS}-${{ matrix.job.target }}
2019-11-25 00:58:55 +00:00
PKG_NAME=${PKG_BASENAME}${PKG_suffix}
echo set-output name=PKG_suffix::${PKG_suffix}
echo set-output name=PKG_BASENAME::${PKG_BASENAME}
echo set-output name=PKG_NAME::${PKG_NAME}
echo ::set-output name=PKG_suffix::${PKG_suffix}
echo ::set-output name=PKG_BASENAME::${PKG_BASENAME}
2019-11-21 05:09:19 +00:00
echo ::set-output name=PKG_NAME::${PKG_NAME}
2019-11-24 19:32:55 +00:00
# deployable tag? (ie, leading "vM" or "M"; M == version number)
2019-12-08 20:09:02 +00:00
unset DEPLOY ; if [[ $REF_TAG =~ ^[vV]?[0-9].* ]]; then DEPLOY='true' ; fi
echo set-output name=DEPLOY::${DEPLOY:-<empty>/false}
2019-11-24 19:32:55 +00:00
echo ::set-output name=DEPLOY::${DEPLOY}
2019-11-30 21:27:21 +00:00
# DPKG architecture?
2021-02-08 00:07:17 +00:00
unset DPKG_ARCH ; case ${{ matrix.job.target }} in aarch64-*-linux-*) DPKG_ARCH=arm64 ;; i686-*-linux-*) DPKG_ARCH=i686 ;; x86_64-*-linux-*) DPKG_ARCH=amd64 ;; esac;
2019-11-30 21:27:21 +00:00
echo set-output name=DPKG_ARCH::${DPKG_ARCH}
echo ::set-output name=DPKG_ARCH::${DPKG_ARCH}
# DPKG version?
unset DPKG_VERSION ; if [[ $REF_TAG =~ ^[vV]?[0-9].* ]]; then DPKG_VERSION=${REF_TAG/#[vV]/} ; fi
echo set-output name=DPKG_VERSION::${DPKG_VERSION}
echo ::set-output name=DPKG_VERSION::${DPKG_VERSION}
# DPKG base name/conflicts?
DPKG_BASENAME=${PROJECT_NAME}
DPKG_CONFLICTS=${PROJECT_NAME}-musl
2019-12-08 20:09:02 +00:00
case ${{ matrix.job.target }} in *-musl) DPKG_BASENAME=${PROJECT_NAME}-musl ; DPKG_CONFLICTS=${PROJECT_NAME} ;; esac;
2019-11-30 21:27:21 +00:00
echo set-output name=DPKG_BASENAME::${DPKG_BASENAME}
echo set-output name=DPKG_CONFLICTS::${DPKG_CONFLICTS}
echo ::set-output name=DPKG_BASENAME::${DPKG_BASENAME}
echo ::set-output name=DPKG_CONFLICTS::${DPKG_CONFLICTS}
# DPKG name
unset DPKG_NAME;
if [[ -n $DPKG_ARCH && -n $DPKG_VERSION ]]; then DPKG_NAME="${DPKG_BASENAME}_${DPKG_VERSION}_${DPKG_ARCH}.deb" ; fi
echo set-output name=DPKG_NAME::${DPKG_NAME}
echo ::set-output name=DPKG_NAME::${DPKG_NAME}
2019-11-24 19:32:55 +00:00
# target-specific options
2019-12-08 20:09:02 +00:00
# * CARGO_USE_CROSS (truthy)
CARGO_USE_CROSS='true' ; case '${{ matrix.job.use-cross }}' in ''|0|f|false|n|no) unset CARGO_USE_CROSS ;; esac;
echo set-output name=CARGO_USE_CROSS::${CARGO_USE_CROSS:-<empty>/false}
echo ::set-output name=CARGO_USE_CROSS::${CARGO_USE_CROSS}
2019-11-24 19:32:55 +00:00
# * test only binary for arm-type targets
2021-02-08 00:07:17 +00:00
unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*-linux-*) CARGO_TEST_OPTIONS="--bin ${PROJECT_NAME}" ;; esac;
2019-11-24 21:22:55 +00:00
echo set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}
2019-11-24 19:32:55 +00:00
echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}
2019-11-25 00:58:55 +00:00
# * strip executable?
2021-02-08 00:07:17 +00:00
STRIP="strip" ; case ${{ matrix.job.target }} in arm-*-linux-*hf) STRIP="arm-linux-gnueabihf-strip" ;; aarch64-*-linux-*) STRIP="aarch64-linux-gnu-strip" ;; *-pc-windows-msvc) STRIP="" ;; esac;
2019-11-24 20:28:57 +00:00
echo set-output name=STRIP::${STRIP}
echo ::set-output name=STRIP::${STRIP}
2019-11-21 01:07:59 +00:00
- name : Create all needed build/work directories
shell : bash
2019-11-25 00:58:55 +00:00
run : |
mkdir -p '${{ steps.vars.outputs.STAGING }}'
mkdir -p '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}'
mkdir -p '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/autocomplete'
2019-11-30 21:27:21 +00:00
mkdir -p '${{ steps.vars.outputs.STAGING }}/dpkg'
2021-01-31 04:29:53 +00:00
- name : Update manpage placeholders
shell : bash
run : |
LSD_VERSION="$(if echo "$GITHUB_REF" | grep -q '^refs/tags'; then echo "${GITHUB_REF#refs/*/}"; else echo; fi)"
sed -i.bk "s|footer: lsd <version>|footer: lsd $LSD_VERSION|" doc/lsd.md
sed -i.bk "s|date: <date>|date: $(date '+%Y-%m-%d')|" doc/lsd.md
rm doc/lsd.md.bk
- name : Setup pandoc
uses : r-lib/actions/setup-pandoc@v1
- name : Generate Manpage
run : pandoc --standalone --to man doc/lsd.md -o lsd.1
2019-11-21 01:07:59 +00:00
- name : Install `rust` toolchain
uses : actions-rs/toolchain@v1
with :
2019-12-02 13:29:56 +00:00
toolchain : ${{ steps.vars.outputs.TOOLCHAIN }}
2019-12-08 20:09:02 +00:00
target : ${{ matrix.job.target }}
2019-11-21 01:07:59 +00:00
override : true
profile : minimal # minimal component installation (ie, no documentation)
- name : Build
uses : actions-rs/cargo@v1
with :
2019-12-08 20:09:02 +00:00
use-cross : ${{ steps.vars.outputs.CARGO_USE_CROSS }}
2019-11-21 01:07:59 +00:00
command : build
2019-12-08 20:09:02 +00:00
args : --release --target=${{ matrix.job.target }}
2019-11-21 01:07:59 +00:00
- name : Test
2023-08-19 16:09:16 +00:00
if : matrix.job.target != 'aarch64-apple-darwin'
2019-11-21 01:07:59 +00:00
uses : actions-rs/cargo@v1
with :
2019-12-08 20:09:02 +00:00
use-cross : ${{ steps.vars.outputs.CARGO_USE_CROSS }}
2019-11-21 01:07:59 +00:00
command : test
2019-12-08 20:09:02 +00:00
args : --target=${{ matrix.job.target }} ${{ steps.vars.outputs.CARGO_TEST_OPTIONS}}
2019-11-21 01:07:59 +00:00
- name : Archive executable artifacts
uses : actions/upload-artifact@master
with :
2019-12-08 20:09:02 +00:00
name : ${{ env.PROJECT_NAME }}-${{ matrix.job.target }}
path : target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}
2019-11-21 01:07:59 +00:00
- name : Package
shell : bash
2019-11-24 20:28:57 +00:00
run : |
2019-11-25 00:58:55 +00:00
# binary
2019-12-08 20:09:02 +00:00
cp 'target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/'
2019-11-25 00:58:55 +00:00
# `strip` binary (if needed)
if [ -n "${{ steps.vars.outputs.STRIP }}" ]; then "${{ steps.vars.outputs.STRIP }}" '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' ; fi
# README and LICENSE
cp README.md '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/'
cp LICENSE '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/'
2021-01-31 04:29:53 +00:00
# manpage
cp lsd.1 '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/'
2019-11-25 00:58:55 +00:00
# autocomplete
2019-12-08 20:09:02 +00:00
cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}-'*/'out/${{ env.PROJECT_NAME }}.bash' '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/autocomplete/${{ env.PROJECT_NAME }}.bash-completion'
cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}-'*/'out/${{ env.PROJECT_NAME }}.fish' '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/autocomplete/'
2023-11-26 01:17:53 +00:00
cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}-'*/'out/_${{ env.PROJECT_NAME }}.ps1' '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/autocomplete/'
2019-12-08 20:09:02 +00:00
cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}-'*/'out/_${{ env.PROJECT_NAME }}' '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/autocomplete/'
2019-11-25 00:58:55 +00:00
# base compressed package
pushd '${{ steps.vars.outputs.STAGING }}/' >/dev/null
2019-12-08 20:09:02 +00:00
case ${{ matrix.job.target }} in
2019-11-25 00:58:55 +00:00
*-pc-windows-*) 7z -y a '${{ steps.vars.outputs.PKG_NAME }}' '${{ steps.vars.outputs.PKG_BASENAME }}'/* | tail -2 ;;
*) tar czf '${{ steps.vars.outputs.PKG_NAME }}' '${{ steps.vars.outputs.PKG_BASENAME }}'/* ;;
esac;
popd >/dev/null
2019-11-30 21:27:21 +00:00
# dpkg
if [ -n "${{ steps.vars.outputs.DPKG_NAME }}" ]; then
DPKG_DIR="${{ steps.vars.outputs.STAGING }}/dpkg"
# binary
2019-12-08 20:09:02 +00:00
install -Dm755 'target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' "${DPKG_DIR}/usr/bin/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}"
2019-11-30 21:27:21 +00:00
if [ -n "${{ steps.vars.outputs.STRIP }}" ]; then "${{ steps.vars.outputs.STRIP }}" "${DPKG_DIR}/usr/bin/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}" ; fi
# README and LICENSE
install -Dm644 README.md "${DPKG_DIR}/usr/share/doc/${{ env.PROJECT_NAME }}/README.md"
install -Dm644 LICENSE "${DPKG_DIR}/usr/share/doc/${{ env.PROJECT_NAME }}/LICENSE"
# (auto-)completions
2019-12-08 20:09:02 +00:00
install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}-'*/'out/${{ env.PROJECT_NAME }}.bash' "${DPKG_DIR}/usr/share/bash-completion/completions/${{ env.PROJECT_NAME }}"
2024-02-04 16:44:31 +00:00
install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}-'*/'out/${{ env.PROJECT_NAME }}.fish' "${DPKG_DIR}/usr/share/fish/vendor_completions.d/${{ env.PROJECT_NAME }}.fish"
2019-12-08 20:09:02 +00:00
install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}-'*/'out/_${{ env.PROJECT_NAME }}' "${DPKG_DIR}/usr/share/zsh/vendor-completions/_${{ env.PROJECT_NAME }}"
2019-11-30 21:27:21 +00:00
# control file
mkdir -p "${DPKG_DIR}/DEBIAN"
printf "Package: ${{ steps.vars.outputs.DPKG_BASENAME }}\nVersion: ${{ steps.vars.outputs.DPKG_VERSION }}\nSection: utils\nPriority: optional\nMaintainer: ${{ env.PROJECT_AUTH }}\nArchitecture: ${{ steps.vars.outputs.DPKG_ARCH }}\nProvides: ${{ env.PROJECT_NAME }}\nConflicts: ${{ steps.vars.outputs.DPKG_CONFLICTS }}\nDescription: ${{ env.PROJECT_DESC }}\n" > "${DPKG_DIR}/DEBIAN/control"
## cat "${DPKG_DIR}/DEBIAN/control"
# build dpkg
fakeroot dpkg-deb --build "${DPKG_DIR}" "${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.DPKG_NAME }}"
2023-12-21 06:20:26 +00:00
# build a deb not using zst
# check https://github.com/lsd-rs/lsd/issues/891
ar x "${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.DPKG_NAME }}"
# Uncompress zstd files an re-compress them using xz
zstd -d < control.tar.zst | xz > control.tar.xz
zstd -d < data.tar.zst | xz > data.tar.xz
# Re-create the Debian package in /tmp/
xz_deb="$(echo ${{ steps.vars.outputs.DPKG_NAME }} | sed 's/.deb/_xz.deb/g')"
ar -m -c -a sdsd ${xz_deb} debian-binary control.tar.xz data.tar.xz
mv ${xz_deb} ${{ steps.vars.outputs.STAGING }}/
# Clean up
rm debian-binary control.tar.xz data.tar.xz control.tar.zst data.tar.zst
2019-11-30 21:27:21 +00:00
fi
2019-11-21 01:07:59 +00:00
- name : Publish
uses : softprops/action-gh-release@v1
2019-11-24 19:32:55 +00:00
if : steps.vars.outputs.DEPLOY
2019-11-21 01:07:59 +00:00
with :
2019-11-25 00:58:55 +00:00
files : |
${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_NAME }}
2023-12-21 06:20:26 +00:00
${{ steps.vars.outputs.STAGING }}/*.deb
2019-11-21 01:07:59 +00:00
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2019-11-25 05:30:38 +00:00
coverage :
name : Code Coverage
2019-12-08 20:09:02 +00:00
runs-on : ${{ matrix.job.os }}
2019-11-25 05:30:38 +00:00
strategy :
fail-fast : true
matrix :
2019-12-08 20:09:02 +00:00
# job: [ { os: ubuntu-latest }, { os: macos-latest }, { os: windows-latest } ]
job : [ { os : ubuntu-latest } ] ## cargo-tarpaulin is currently only available on linux
2019-11-25 05:30:38 +00:00
steps :
- uses : actions/checkout@v1
# - name: Reattach HEAD ## may be needed for accurate code coverage info
# run: git checkout ${{ github.head_ref }}
- name : Initialize workflow variables
id : vars
shell : bash
run : |
# staging directory
STAGING='_staging'
echo set-output name=STAGING::${STAGING}
echo ::set-output name=STAGING::${STAGING}
# check for CODECOV_TOKEN availability (work-around for inaccessible 'secrets' object for 'if'; see <https://github.community/t5/GitHub-Actions/jobs-lt-job-id-gt-if-does-not-work-with-env-secrets/m-p/38549>)
unset HAS_CODECOV_TOKEN
if [ -n $CODECOV_TOKEN ]; then HAS_CODECOV_TOKEN='true' ; fi
echo set-output name=HAS_CODECOV_TOKEN::${HAS_CODECOV_TOKEN}
echo ::set-output name=HAS_CODECOV_TOKEN::${HAS_CODECOV_TOKEN}
env :
CODECOV_TOKEN : "${{ secrets.CODECOV_TOKEN }}"
- name : Create all needed build/work directories
shell : bash
run : |
mkdir -p '${{ steps.vars.outputs.STAGING }}/work'
- name : Install required packages
run : |
sudo apt-get -y install libssl-dev
pushd '${{ steps.vars.outputs.STAGING }}/work' >/dev/null
2020-06-18 13:34:01 +00:00
wget --no-verbose https://github.com/xd009642/tarpaulin/releases/download/0.13.3/cargo-tarpaulin-0.13.3-travis.tar.gz
2020-06-18 13:35:11 +00:00
tar xf cargo-tarpaulin-0.13.3-travis.tar.gz
2019-11-25 05:30:38 +00:00
cp cargo-tarpaulin "$(dirname -- "$(which cargo)")"/
popd >/dev/null
- name : Generate coverage
run : |
cargo tarpaulin --out Xml
- name : Upload coverage results (CodeCov.io)
# CODECOV_TOKEN (aka, "Repository Upload Token" for REPO from CodeCov.io) ## set via REPO/Settings/Secrets
# if: secrets.CODECOV_TOKEN (not supported {yet?}; see <https://github.community/t5/GitHub-Actions/jobs-lt-job-id-gt-if-does-not-work-with-env-secrets/m-p/38549>)
if : steps.vars.outputs.HAS_CODECOV_TOKEN
run : |
# CodeCov.io
cargo tarpaulin --out Xml
bash <(curl -s https://codecov.io/bash)
env :
CODECOV_TOKEN : "${{ secrets.CODECOV_TOKEN }}"