-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: cleanup caches by a branch | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
|
||
jobs: | ||
cleanup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Cleanup | ||
run: | | ||
gh extension install actions/gh-actions-cache | ||
REPO=${{ github.repository }} | ||
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge" | ||
echo "Fetching list of cache key" | ||
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 ) | ||
## Setting this to not fail the workflow while deleting cache keys. | ||
set +e | ||
echo "Deleting caches..." | ||
for cacheKey in $cacheKeysForPR | ||
do | ||
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm | ||
done | ||
echo "Done" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
container: | ||
image: alt:sisyphus | ||
|
||
env: | ||
CC: ccache gcc | ||
CCACHE_DIR: ${{ github.workspace }}/.ccache | ||
CXX: ccache g++ | ||
USE_CCACHE: 1 | ||
|
||
options: --privileged | ||
steps: | ||
- name: install packages | ||
run: | | ||
|
@@ -28,18 +22,17 @@ jobs: | |
libmosquitto-devel \ | ||
libopen62541-devel libopen62541pp-devel \ | ||
libclickhouse-cpp-devel \ | ||
xsltproc python3-dev python-module-distribute swig iputils | ||
xsltproc python-base python3-dev swig python-devel \ | ||
python-module-distribute swig iputils | ||
- name: cache | ||
uses: actions/cache@v2 | ||
if: always() | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
path: ${{ env.CCACHE_DIR }} | ||
key: ${{ runner.os }}-ccache | ||
restore-keys: | | ||
${{ runner.os }}-ccache | ||
key: ${{ vars.GITHUB_REF_NAME }} | ||
|
||
- uses: actions/checkout@v2 | ||
- name: configure | ||
run: | | ||
export CCACHE_ENABLE=yes | ||
|
@@ -53,6 +46,7 @@ jobs: | |
run: | | ||
export GCC_USE_CCACHE=1 | ||
export ALLOW_ROOT_USER=1 | ||
echo "%_topdir %homedir/RPM" >> ~/.rpmmacros | ||
jmake | ||
- name: testsuite | ||
run: | | ||
|