Fix spk export failing if builds are missing #1342
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
paths: | |
# Only run coverage report if the sources have changed | |
- "src/**.rs" | |
- "crates/**.rs" | |
push: | |
branches: | |
- main | |
paths: | |
# Only run coverage report if the sources have changed | |
- "src/**.rs" | |
- "crates/**.rs" | |
name: Code Coverage | |
jobs: | |
codecov: | |
runs-on: ubuntu-latest | |
container: | |
image: xd009642/tarpaulin:0.25.2 | |
options: --security-opt seccomp=unconfined --privileged | |
steps: | |
- name: Setup spfs repos | |
run: | | |
mkdir /spfs | |
mkdir -p /tmp/spfs-repos/local | |
mkdir -p /tmp/spfs-repos/origin | |
cat >/etc/spfs.conf << EOF | |
[storage] | |
root = /tmp/spfs-repos/local | |
[remote.origin] | |
address = file:///tmp/spfs-repos/origin?create=true | |
EOF | |
- name: Install prerequisites | |
run: | | |
apt-get update | |
apt-get install --yes libcap2-bin tcsh rsync sudo protobuf-compiler fuse libfuse-dev | |
# spfs "custom build command" needs rustfmt? (protobufs?) | |
rustup component add rustfmt | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install spfs | |
run: | | |
make install-debug-spfs | |
- name: Generate code coverage | |
run: | | |
# Enable migration-to-components feature here so that the test suite | |
# is run with that feature enabled. Not specifically for coverage | |
# purposes, but because there wouldn't otherwise be a run of the | |
# test suite with this feature enabled anywhere in the currently | |
# configured github workflows. Tests have frequently not passed when | |
# this feature is enabled. | |
spfs run - -- bash -c 'cargo tarpaulin --features migration-to-components --workspace --verbose --timeout 120 --out Xml' | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |