[wip] prep work for caching builds of Testground executable

This commit is contained in:
Michael Bradley, Jr 2022-09-19 16:37:39 -05:00
parent d066f18969
commit 14ba617107
No known key found for this signature in database
GPG Key ID: D0307DBCF21A9A58

View File

@ -28,13 +28,22 @@ jobs:
defaults: defaults:
run: run:
shell: ${{ matrix.shell }} {0} shell: ${{ matrix.shell }} {0}
working-directory: nim-codex
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.nim_branch }})' name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.nim_branch }})'
runs-on: ${{ matrix.builder }} runs-on: ${{ matrix.builder }}
timeout-minutes: 80 timeout-minutes: 80
steps: steps:
- name: Checkout sources - name: Checkout nim-codex sources
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
path: nim-codex
- name: Checkout Testground sources
uses: actions/checkout@v3
with:
path: testground
repository: testground/testground
- name: APT (Linux amd64) - name: APT (Linux amd64)
if: runner.os == 'Linux' && matrix.target.cpu == 'amd64' if: runner.os == 'Linux' && matrix.target.cpu == 'amd64'
@ -45,30 +54,34 @@ jobs:
- name: Derive environment variables - name: Derive environment variables
run: | run: |
PLATFORM=x64 # Add executables built with Go to PATH
echo "PLATFORM=${PLATFORM}" >> ${GITHUB_ENV} echo "${HOME}/go/bin" >> ${GITHUB_PATH}
# Stack usage on Linux amd64 # - name: Restore Testground executable from cache
NIMFLAGS="${NIMFLAGS} -d:limitStackUsage" # id: testground-exe-cache
echo "NIMFLAGS=${NIMFLAGS}" >> ${GITHUB_ENV} # uses: actions/cache@v3
# with:
# path: ~/go/bin/testground
# key: ${{ matrix.target.os }}-${{ matrix.target.cpu }}-nim-${{ matrix.nim_branch }}-${{ ... }}-cache_nonce:${{ matrix.cache_nonce }}
# Use all available CPUs for build process # - name: Build and start Testground daemon
ncpu=$(nproc) # run: |
[[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1 # mkdir -p ${HOME}/repos && cd ${HOME}/repos
echo "ncpu=${ncpu}" >> ${GITHUB_ENV} # git clone https://github.com/testground/testground.git && cd testground
# make install
# export PATH="${HOME}/go/bin:${PATH}"
# testground daemon &
- name: Build and start Testground daemon - name: Build Testground executable
run: | run: make install
mkdir -p ${HOME}/repos && cd ${HOME}/repos working-directory: testground
git clone https://github.com/testground/testground.git && cd testground
make install - name: Start Testground executable
export PATH="${HOME}/go/bin:${PATH}" run: testground daemon &
testground daemon &
- name: Build and run default Codex Testground plan - name: Build and run default Codex Testground plan
run: | run: |
export PATH="${HOME}/go/bin:${PATH}"
make \ make \
TESTGROUND_PLAN=simple_libp2p \ TESTGROUND_PLAN=simple_libp2p \
TESTGROUND_OPTIONS="--instances=25 --wait" \ TESTGROUND_OPTIONS="--instances=10 --wait" \
testground testground