Skip to content

Commit

Permalink
smoke ci configurations: add configurations to stetup fscache
Browse files Browse the repository at this point in the history
Since using `/dev/cachefiles` requires sudo mode, so some environment variables are defined and we use `sudo -E` to pass these environment variables to sudo mode.
  • Loading branch information
hijackthe2 committed Oct 28, 2023
1 parent 6fbb129 commit 71aae1c
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,26 @@ jobs:
shared-key: nydus-build
- name: Install cargo nextest
uses: taiki-e/install-action@nextest
- name: Fscache Setup
run: |
sudo apt update
sudo apt install -y cachefilesd
sudo apt list --installed | grep cachefilesd
sudo chmod a+w /etc/default/cachefilesd
sudo sed -i 's/#RUN=yes/RUN=yes/' /etc/default/cachefilesd
sudo cat /etc/default/cachefilesd
sudo /sbin/modprobe -qab cachefiles
sudo /sbin/cachefilesd -f /etc/cachefilesd.conf
sudo systemctl status cachefilesd
[ -c /dev/cachefiles ] && echo "cachefilesd is successfully enabled"
pid=$(sudo lsof /dev/cachefiles | awk '{if (NR>1) {print $2}}')
sudo kill -9 $pid
echo "/dev/cachefiles is available now"
- name: Unit Test
run: |
make ut-nextest
CARGO_HOME=${HOME}/.cargo
CARGO_BIN=$(which cargo)
sudo -E CARGO=${CARGO_BIN} make ut-nextest
nydus-unit-test-coverage:
runs-on: ubuntu-latest
Expand All @@ -624,8 +641,26 @@ jobs:
cache-on-failure: true
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Fscache Setup
run: |
sudo apt update
sudo apt install -y cachefilesd
sudo apt list --installed | grep cachefilesd
sudo chmod a+w /etc/default/cachefilesd
sudo sed -i 's/#RUN=yes/RUN=yes/' /etc/default/cachefilesd
sudo cat /etc/default/cachefilesd
sudo /sbin/modprobe -qab cachefiles
sudo /sbin/cachefilesd -f /etc/cachefilesd.conf
sudo systemctl status cachefilesd
[ -c /dev/cachefiles ] && echo "cachefilesd is successfully enabled"
pid=$(sudo lsof /dev/cachefiles | awk '{if (NR>1) {print $2}}')
sudo kill -9 $pid
echo "/dev/cachefiles is available now"
- name: Generate code coverage
run: make coverage-codecov
run: |
CARGO_HOME=${HOME}/.cargo
CARGO_BIN=$(which cargo)
sudo -E CARGO=${CARGO_BIN} make coverage-codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down

0 comments on commit 71aae1c

Please sign in to comment.