Skip to content

Commit

Permalink
(github): update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
vpashka committed Mar 30, 2024
1 parent 6bfbcb9 commit 36e5776
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 16 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/cleanup.yml
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 }}
26 changes: 10 additions & 16 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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: |
Expand Down

0 comments on commit 36e5776

Please sign in to comment.