Skip to content

Commit 5c8ee0f

Browse files
committed
Some cache and coverage enhancements
1 parent 663f1b4 commit 5c8ee0f

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/tests.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ jobs:
3131
id: cache-apt
3232
uses: actions/cache@v1
3333
with:
34-
path: /var/cache/apt/
34+
path: ~/.apt-cache
3535
key: ${{ runner.os }}-apt
3636
- name: Install needed packages
37-
run: sudo apt-get install mysql-client libcurl4-openssl-dev libelf-dev libdw-dev cmake -y --no-install-recommends
37+
run: |
38+
sudo rm -rf /var/cache/apt/archives && sudo ln -s ~/.apt-cache /var/cache/apt/archives && mkdir -p ~/.apt-cache/partial
39+
sudo apt-get install mysql-client libcurl4-openssl-dev libelf-dev libdw-dev cmake -y --no-install-recommends
40+
sudo chmod -R 777 ~/.apt-cache
3841
- name: Cache kcov
3942
id: cache-kcov-37
4043
uses: actions/cache@v1
@@ -49,6 +52,11 @@ jobs:
4952
cmake -DCMAKE_INSTALL_PREFIX=/usr .. && make &&
5053
sudo make install && cd ../.. &&
5154
kcov --version
55+
- name: Install kcov from cache
56+
if: steps.cache-kcov-37.outputs.cache-hit == 'true'
57+
run: |
58+
cd kcov-37/build && sudo make install && cd ../.. &&
59+
kcov --version
5260
- name: Run tests and coverage
5361
env:
5462
TEST_MYSQL_HOST: "127.0.0.1"
@@ -58,9 +66,11 @@ jobs:
5866
run: |
5967
mysql --host ${TEST_MYSQL_HOST} -u${TEST_MYSQL_USER} -p${TEST_MYSQL_PASS} --port ${TEST_MYSQL_PORT} -e "use mysql; delete from user where User != 'root' OR host != '%'; update user set authentication_string=PASSWORD('testbench'), host='%', password_last_changed=FROM_UNIXTIME(1523829600) where User='root'; update user set plugin='mysql_native_password'; delete from user where User = 'sys'; FLUSH PRIVILEGES;"
6068
./tests.sh
61-
kcov --include-pattern=backup.sh,tests.sh --exclude-pattern=coverage coverage ./tests.sh
69+
kcov --include-pattern=backup.sh,tests.sh --exclude-pattern=coverage $(pwd)/coverage ./tests.sh
70+
mv $(pwd)/coverage/tests.sh/cov.xml $(pwd)/cov.xml
6271
sleep 2
6372
- name: Send coverage
6473
uses: codecov/codecov-action@v1
6574
with:
6675
token: ${{ secrets.CODECOV_TOKEN }}
76+
file: ./cov.xml

0 commit comments

Comments
 (0)