Skip to content

Commit

Permalink
[actions] in .github/workflows/testsuite, first rough workflow to rep…
Browse files Browse the repository at this point in the history
…eat the build/test jobs twice (for FPTYPE=d,f)

This must be cleaned up
- the cache cleanup job must be split up (codegen cache cleanup once, build cache cleanup once per build type)
- the Process+fptype tag must become a more general build tag for caches (eventually add inl, hrdcod)
  • Loading branch information
valassi committed Nov 8, 2023
1 parent 75a40b8 commit 6e3cc3b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/testsuite_oneprocess.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ function build() {
# Iterate over P* directories and build
cd ${topdir}/epochX/cudacpp/${proc}
echo "Current directory is $(pwd)"
echo "FPTYPE=${FPTYPE}"
gtestlibs=0
pdirs="$(ls -d SubProcesses/P*_*)"
for pdir in ${pdirs}; do
Expand Down Expand Up @@ -192,6 +193,7 @@ function tput_test() {
# Iterate over P* directories and run tests
cd ${topdir}/epochX/cudacpp/${proc}
echo "Current directory is $(pwd)"
echo "FPTYPE=${FPTYPE}"
pdirs="$(ls -d SubProcesses/P*_*)"
for pdir in ${pdirs}; do
pushd $pdir >& /dev/null
Expand Down
38 changes: 25 additions & 13 deletions .github/workflows/testsuite_oneprocess.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,24 @@ jobs:
gh actions-cache list -R $REPO --sort created-at --order asc --key codegencache-${{ runner.os }}-${{ inputs.process }}
echo "List codegencache keys (end)"
cacheKeysCodegen=$(gh actions-cache list -R $REPO --sort created-at --order asc --key codegencache-${{ runner.os }}-${{ inputs.process }} | cut -f 1) # delete ALL codegen caches
#--- LIST BUILD CACHES
#--- LIST BUILD CACHES (d)
echo "List buildcache keys (start)"
gh actions-cache list -R $REPO --sort created-at --order asc --key buildcache-${{ runner.os }}-${{ inputs.process }}
gh actions-cache list -R $REPO --sort created-at --order asc --key buildcache-${{ runner.os }}-${{ inputs.process }}-d
echo "List buildcache keys (end)"
cacheKeysBuild=$(gh actions-cache list -R $REPO --sort created-at --order asc --key buildcache-${{ runner.os }}-${{ inputs.process }} | cut -f 1 | head --lines=-1) # keep only the most recent build cache
cacheKeysBuildD=$(gh actions-cache list -R $REPO --sort created-at --order asc --key buildcache-${{ runner.os }}-${{ inputs.process }}-d | cut -f 1 | head --lines=-1) # keep only the most recent build cache
#--- LIST BUILD CACHES (f)
echo "List buildcache keys (start)"
gh actions-cache list -R $REPO --sort created-at --order asc --key buildcache-${{ runner.os }}-${{ inputs.process }}-f
echo "List buildcache keys (end)"
cacheKeysBuildF=$(gh actions-cache list -R $REPO --sort created-at --order asc --key buildcache-${{ runner.os }}-${{ inputs.process }}-f | cut -f 1 | head --lines=-1) # keep only the most recent build cache
#--- DELETE CODEGEN AND BUILD CACHES
set +e # do not fail while deleting cache keys
echo "Deleting codegen caches..."
for cacheKey in $cacheKeysCodegen; do gh actions-cache delete $cacheKey -R $REPO --confirm; done
echo "Deleting codegen caches... done"
echo "Deleting build caches..."
for cacheKey in $cacheKeysBuild; do gh actions-cache delete $cacheKey -R $REPO --confirm; done
for cacheKey in $cacheKeysBuildD; do gh actions-cache delete $cacheKey -R $REPO --confirm; done
for cacheKey in $cacheKeysBuildF; do gh actions-cache delete $cacheKey -R $REPO --confirm; done
echo "Deleting build caches... done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -140,6 +146,13 @@ jobs:
runs-on: ubuntu-latest
needs: codegen

strategy:
matrix:
fptype: [d, f]

env:
FPTYPE: ${{ matrix.fptype }}

steps:
- # See https://github.com/actions/checkout
# (NB actions/checkout needs "Allow owner and select non-owner" and "Allow actions created by github")
Expand All @@ -149,7 +162,7 @@ jobs:

- name: HELLO_TESTSUITE
run: |
echo "HELLO_TESTSUITE ${{ inputs.process }}! $(date)"
echo "HELLO_TESTSUITE ${{ inputs.process }} FPTYPE=${{ matrix.fptype }}! $(date)"
echo "Current directory is $(pwd)"
###echo "Current git commit is $(git log --oneline -n1 | cut -d' ' -f1)"
# See https://github.com/actions/cache/blob/main/tips-and-workarounds.md#force-deletion-of-caches-overriding-default-cache-eviction-policy
Expand All @@ -159,7 +172,7 @@ jobs:
gh actions-cache list -R $REPO --sort created-at --order asc --key codegencache-${{ runner.os }}-${{ inputs.process }}
echo "List codegencache keys (end)"
echo "List buildcache keys (start)"
gh actions-cache list -R $REPO --sort created-at --order asc --key buildcache-${{ runner.os }}-${{ inputs.process }}
gh actions-cache list -R $REPO --sort created-at --order asc --key buildcache-${{ runner.os }}-${{ inputs.process }}-${{ matrix.fptype }}
echo "List buildcache keys (end)"
env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -186,14 +199,13 @@ jobs:
CCACHE_DIR
DOWNLOADS
test/googletest
key: buildcache-${{ runner.os }}-${{ inputs.process }}-${{ github.run_id }}
key: buildcache-${{ runner.os }}-${{ inputs.process }}-${{ matrix.fptype }}-${{ github.run_id }}
restore-keys:
buildcache-${{ runner.os }}-${{ inputs.process }}
cache-${{ runner.os }}-${{ inputs.process }} # TEMPORARY!
buildcache-${{ runner.os }}-${{ inputs.process }}-${{ matrix.fptype }}

- name: before_build
run: .github/workflows/testsuite_oneprocess.sh before_build ${{ inputs.process }}

- name: build
run: .github/workflows/testsuite_oneprocess.sh build ${{ inputs.process }}

Expand All @@ -209,7 +221,7 @@ jobs:
CCACHE_DIR
DOWNLOADS
test/googletest
key: buildcache-${{ runner.os }}-${{ inputs.process }}-${{ github.run_id }}
key: buildcache-${{ runner.os }}-${{ inputs.process }}-${{ matrix.fptype }}-${{ github.run_id }}

- name: tput_test
run: .github/workflows/testsuite_oneprocess.sh tput_test ${{ inputs.process }}
Expand All @@ -220,15 +232,15 @@ jobs:

- name: GOODBYE_TESTSUITE
run: |
echo "GOODBYE_TESTSUITE ${{ inputs.process }}! $(date)"
echo "GOODBYE_TESTSUITE ${{ inputs.process }} FPTYPE=${{ matrix.fptype }}! $(date)"
echo "Current directory is $(pwd)"
echo "Current git commit is $(git log --oneline -n1 | cut -d' ' -f1)"
REPO=${{ github.repository }}
echo "List codegencache keys (start)"
gh actions-cache list -R $REPO --sort created-at --order asc --key codegencache-${{ runner.os }}-${{ inputs.process }}
echo "List codegencache keys (end)"
echo "List buildcache keys (start)"
gh actions-cache list -R $REPO --sort created-at --order asc --key buildcache-${{ runner.os }}-${{ inputs.process }}
gh actions-cache list -R $REPO --sort created-at --order asc --key buildcache-${{ runner.os }}-${{ inputs.process }}-${{ matrix.fptype }}
echo "List buildcache keys (end)"
env:
GH_TOKEN: ${{ github.token }}
Expand Down

0 comments on commit 6e3cc3b

Please sign in to comment.