Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7d9b15158 | ||
|
|
c164b24049 | ||
|
|
e5e32c7c0a | ||
|
|
e509958ad9 | ||
|
|
40fde07559 | ||
|
|
2748dde76a | ||
|
|
fa34779b3d |
@@ -86,6 +86,11 @@ runs:
|
||||
|
||||
- name: Load cache and build
|
||||
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
env:
|
||||
AWS_BUCKET: ${{ inputs.s3-cache-bucket }}
|
||||
AWS_REGION: ${{ inputs.aws-region }}
|
||||
AWS_ACCESS_KEY_ID: ${{ inputs.s3-access-key-id }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ inputs.s3-secret-access-key }}
|
||||
run: npm run cache -- load
|
||||
shell: bash
|
||||
|
||||
|
||||
@@ -78,6 +78,11 @@ runs:
|
||||
|
||||
- name: Load cache and build
|
||||
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
env:
|
||||
AWS_BUCKET: ${{ inputs.s3-cache-bucket }}
|
||||
AWS_REGION: ${{ inputs.aws-region }}
|
||||
AWS_ACCESS_KEY_ID: ${{ inputs.s3-access-key-id }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ inputs.s3-secret-access-key }}
|
||||
run: npm run cache -- load
|
||||
shell: bash
|
||||
|
||||
|
||||
@@ -36,50 +36,6 @@ inputs:
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
# - name: List caches via API
|
||||
# shell: bash
|
||||
# run: |
|
||||
# ENDPOINT=${{ github.api_url }}/repos/${{ github.repository }}/actions/caches
|
||||
# curl -L \
|
||||
# $ENDPOINT
|
||||
# # curl -L \
|
||||
# # $ENDPOINT/my-tmp-cache
|
||||
|
||||
# - name: Fetch tmp cache
|
||||
# uses: actions/cache@v3
|
||||
# id: fetch-tmp-cache
|
||||
# with:
|
||||
# path: /tmp/cache
|
||||
# key: my-tmp-cache
|
||||
|
||||
# - name: Create tmp cache if not exists
|
||||
# shell: bash
|
||||
# if: steps.fetch-tmp-cache.outputs.cache-hit != 'true'
|
||||
# run: |
|
||||
# mkdir -p /tmp/cache
|
||||
# echo "Hello, World!" > /tmp/cache/hello.txt
|
||||
|
||||
# - name: Get values
|
||||
# shell: bash
|
||||
# run: |
|
||||
# echo ${{ github.api_url }}
|
||||
# echo ${{ github.event_name }}
|
||||
# echo ${{ github.repository }}
|
||||
# echo ${{ github.repositoryUrl }}
|
||||
# SECRET=${{ github.token }}
|
||||
# echo ${SECRET:0:4}
|
||||
|
||||
# - name: Restore image from cache
|
||||
# id: deps-cache
|
||||
# uses: actions/cache@v3
|
||||
# with:
|
||||
# path: nimbledeps
|
||||
# # Using nim.branch as a simple way to differentiate between nimble using the "pkgs" or "pkgs2" directories.
|
||||
# # The change happened on Nimble v0.14.0.
|
||||
# key: nimbledeps-${{ matrix.nim.branch }}-${{ hashFiles('.pinned') }} # hashFiles returns a different value on windows
|
||||
|
||||
# -----< CACHED STEPS >-----
|
||||
|
||||
- name: Configure AWS credentials for S3 build cache
|
||||
if: inputs.s3-access-key-id != '' && inputs.s3-secret-access-key != ''
|
||||
run: |
|
||||
@@ -122,6 +78,11 @@ runs:
|
||||
|
||||
- name: Load cache and build
|
||||
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
env:
|
||||
AWS_BUCKET: ${{ inputs.s3-cache-bucket }}
|
||||
AWS_REGION: ${{ inputs.aws-region }}
|
||||
AWS_ACCESS_KEY_ID: ${{ inputs.s3-access-key-id }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ inputs.s3-secret-access-key }}
|
||||
run: npm run cache -- load
|
||||
shell: bash
|
||||
|
||||
@@ -135,57 +96,55 @@ runs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# - name: Push the image cache
|
||||
# if: env.PUSH_CACHE == 'true'
|
||||
# working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
# env:
|
||||
# AWS_BUCKET: ${{ inputs.s3-cache-bucket }}
|
||||
# AWS_REGION: ${{ inputs.aws-region }}
|
||||
# AWS_ACCESS_KEY_ID: ${{ inputs.s3-access-key-id }}
|
||||
# AWS_SECRET_ACCESS_KEY: ${{ inputs.s3-secret-access-key }}
|
||||
# run: npm run cache -- push
|
||||
# shell: bash
|
||||
- name: Push the image cache
|
||||
if: env.PUSH_CACHE == 'true'
|
||||
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
env:
|
||||
AWS_BUCKET: ${{ inputs.s3-cache-bucket }}
|
||||
AWS_REGION: ${{ inputs.aws-region }}
|
||||
AWS_ACCESS_KEY_ID: ${{ inputs.s3-access-key-id }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ inputs.s3-secret-access-key }}
|
||||
run: npm run cache -- push
|
||||
shell: bash
|
||||
|
||||
# -----< CACHED STEPS >-----
|
||||
- name: Run the test
|
||||
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
env:
|
||||
WORKER_COUNT: ${{ inputs.worker-count }}
|
||||
EXTRA_VERSION: ${{ inputs.extra-versions }}
|
||||
NAME_FILTER: ${{ inputs.test-filter }}
|
||||
NAME_IGNORE: ${{ inputs.test-ignore }}
|
||||
run: npm run test -- --extra-version=$EXTRA_VERSION --name-filter=$NAME_FILTER --name-ignore=$NAME_IGNORE
|
||||
shell: bash
|
||||
|
||||
# - name: Run the test
|
||||
# working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
# env:
|
||||
# WORKER_COUNT: ${{ inputs.worker-count }}
|
||||
# EXTRA_VERSION: ${{ inputs.extra-versions }}
|
||||
# NAME_FILTER: ${{ inputs.test-filter }}
|
||||
# NAME_IGNORE: ${{ inputs.test-ignore }}
|
||||
# run: npm run test -- --extra-version=$EXTRA_VERSION --name-filter=$NAME_FILTER --name-ignore=$NAME_IGNORE
|
||||
# shell: bash
|
||||
- name: Print the results
|
||||
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
run: cat results.csv
|
||||
shell: bash
|
||||
|
||||
# - name: Print the results
|
||||
# working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
# run: cat results.csv
|
||||
# shell: bash
|
||||
- name: Render results
|
||||
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
run: npm run renderResults > ./dashboard.md
|
||||
shell: bash
|
||||
|
||||
# - name: Render results
|
||||
# working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
# run: npm run renderResults > ./dashboard.md
|
||||
# shell: bash
|
||||
- name: Show Dashboard Output
|
||||
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
run: cat ./dashboard.md >> $GITHUB_STEP_SUMMARY
|
||||
shell: bash
|
||||
|
||||
# - name: Show Dashboard Output
|
||||
# working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
# run: cat ./dashboard.md >> $GITHUB_STEP_SUMMARY
|
||||
# shell: bash
|
||||
- name: Exit with Error
|
||||
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
run: |
|
||||
if grep -q ":red_circle:" ./dashboard.md; then
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
# - name: Exit with Error
|
||||
# working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
|
||||
# run: |
|
||||
# if grep -q ":red_circle:" ./dashboard.md; then
|
||||
# exit 1
|
||||
# else
|
||||
# exit 0
|
||||
# fi
|
||||
# shell: bash
|
||||
|
||||
# - uses: actions/upload-artifact@v3
|
||||
# with:
|
||||
# name: test-plans-output
|
||||
# path: |
|
||||
# ${{ steps.find-workdir.outputs.WORK_DIR }}/results.csv
|
||||
# ${{ steps.find-workdir.outputs.WORK_DIR }}/dashboard.md
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: test-plans-output
|
||||
path: |
|
||||
${{ steps.find-workdir.outputs.WORK_DIR }}/results.csv
|
||||
${{ steps.find-workdir.outputs.WORK_DIR }}/dashboard.md
|
||||
|
||||
@@ -1,152 +1,152 @@
|
||||
# name: Add new implementation versions
|
||||
name: Add new implementation versions
|
||||
|
||||
# on:
|
||||
# workflow_dispatch:
|
||||
# schedule:
|
||||
# # “At minute 36 past every 24th hour.” - https://crontab.guru/#36_*/24_*_*_*
|
||||
# - cron: '36 */24 * * *'
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# “At minute 36 past every 24th hour.” - https://crontab.guru/#36_*/24_*_*_*
|
||||
- cron: '36 */24 * * *'
|
||||
|
||||
# defaults:
|
||||
# run:
|
||||
# shell: bash
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
# permissions:
|
||||
# contents: write
|
||||
# pull-requests: write
|
||||
# actions: write
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
actions: write
|
||||
|
||||
# jobs:
|
||||
# add:
|
||||
# name: Add new ${{ matrix.repository_name }} version to ${{ matrix.test_name }}
|
||||
# runs-on: ubuntu-latest
|
||||
# strategy:
|
||||
# fail-fast: false
|
||||
# matrix:
|
||||
# include:
|
||||
# - repository_name: go-libp2p
|
||||
# implementation_name: go-libp2p
|
||||
# test_name: perf
|
||||
# implementation_update_script: |
|
||||
# sed -i "1s/$LOCAL_MAJOR_MINOR_VERSION/$REMOTE_MAJOR_MINOR_VERSION/g" go.mod
|
||||
# go mod tidy -go=$GO_MAJOR_MINOR_VERSION
|
||||
# go mod tidy
|
||||
# go get github.com/libp2p/go-libp2p@$REMOTE_VERSION
|
||||
# - repository_name: go-libp2p
|
||||
# implementation_name: go
|
||||
# test_name: transport-interop
|
||||
# implementation_update_script: |
|
||||
# sed -i "s/image_name := go-${LOCAL_MAJOR_MINOR_VERSION}/image_name := go-${REMOTE_MAJOR_MINOR_VERSION}/g" Makefile
|
||||
# sed -i "s/version := ${LOCAL_MAJOR_MINOR_VERSION#v}\..*/version := ${REMOTE_VERSION#v}/g" Makefile
|
||||
# make version.lock
|
||||
# - repository_name: rust-libp2p
|
||||
# implementation_name: rust-libp2p
|
||||
# test_name: perf
|
||||
# implementation_update_script: |
|
||||
# sed -i "s/commitSha := .*/commitSha := ${REMOTE_SHA}/g" Makefile
|
||||
# - repository_name: rust-libp2p
|
||||
# implementation_name: rust
|
||||
# test_name: transport-interop
|
||||
# implementation_update_script: |
|
||||
# sed -i "s/image_name := rust-${LOCAL_MAJOR_MINOR_VERSION}/image_name := rust-${REMOTE_MAJOR_MINOR_VERSION}/g" Makefile
|
||||
# sed -i "s/commitSha := .*/commitSha := ${REMOTE_SHA}/g" Makefile
|
||||
# - repository_name: js-libp2p
|
||||
# implementation_name: js-libp2p
|
||||
# test_name: perf
|
||||
# implementation_update_script: |
|
||||
# suffix="$(echo "${REMOTE_MAJOR_MINOR_VERSION#v}" | sed 's/\./-/g')"
|
||||
# sed -i "s/perf-js-libp2p-[^\"]*/perf-js-libp2p-$suffix/g" package.json
|
||||
# npm install libp2p@$REMOTE_VERSION
|
||||
# - repository_name: js-libp2p
|
||||
# implementation_name: js
|
||||
# test_name: transport-interop
|
||||
# implementation_update_script: |
|
||||
# sed -i "s/image_name := js-${LOCAL_MAJOR_MINOR_VERSION}\..*/image_name := js-${REMOTE_VERSION}/g" Makefile
|
||||
# npm install libp2p@$REMOTE_VERSION
|
||||
# env:
|
||||
# BRANCH: add/${{ matrix.test_name }}/${{ matrix.repository_name }}
|
||||
# steps:
|
||||
# - name: Checkout test-plans
|
||||
# uses: actions/checkout@v4
|
||||
# - name: Configure git
|
||||
# run: |
|
||||
# git fetch origin $BRANCH && git checkout $BRANCH || git checkout -b $BRANCH
|
||||
# git rebase $GITHUB_REF -X theirs || git rebase --abort
|
||||
# git config --global user.email $GITHUB_ACTOR@users.noreply.github.com
|
||||
# git config --global user.name $GITHUB_ACTOR
|
||||
# - id: go
|
||||
# uses: actions/setup-go@v5
|
||||
# with:
|
||||
# go-version: stable
|
||||
# - name: Get the latest version (local)
|
||||
# id: local
|
||||
# env:
|
||||
# IMPLEMENTATION_DIRECTORY: ${{ matrix.test_name }}/impl/${{ matrix.implementation_name }}
|
||||
# run: |
|
||||
# pushd $IMPLEMENTATION_DIRECTORY
|
||||
# ls -d v* | sort -V | tail -n-1 | xargs -I{} echo "version={}" | tee -a $GITHUB_OUTPUT
|
||||
# popd
|
||||
# - name: Get the latest version (remote)
|
||||
# id: remote
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ github.token }}
|
||||
# REPOSITORY_NAME: ${{ matrix.repository_name }}
|
||||
# run: |
|
||||
# releases="$(gh api --paginate repos/libp2p/$REPOSITORY_NAME/releases)"
|
||||
# latest="$(jq 'map(select(.tag_name | startswith("libp2p-"))) | first' <<< "$releases")"
|
||||
# if [[ "$latest" == "null" ]]; then
|
||||
# latest="$(jq 'first' <<< "$releases")"
|
||||
# fi
|
||||
# tag_name=$(jq -r '.tag_name' <<< "$latest")
|
||||
# target_commitish=$(jq -r '.target_commitish' <<< "$latest")
|
||||
# echo "version=${tag_name#libp2p-}" | tee -a $GITHUB_OUTPUT
|
||||
# echo "target_commitish=${target_commitish}" | tee -a $GITHUB_OUTPUT
|
||||
# - id: mm
|
||||
# env:
|
||||
# REMOTE_VERSION: ${{ steps.remote.outputs.version }}
|
||||
# GO_VERSION: ${{ steps.go.outputs.go-version }}
|
||||
# run: |
|
||||
# echo $REMOTE_VERSION | sed 's/\.[0-9]*$//' | xargs -I{} echo "remote={}" | tee -a $GITHUB_OUTPUT
|
||||
# echo $GO_VERSION | sed 's/\.[0-9]*$//' | xargs -I{} echo "go={}" | tee -a $GITHUB_OUTPUT
|
||||
# - name: Add the latest version
|
||||
# if: ${{ !startsWith(steps.remote.outputs.version, steps.local.outputs.version) }}
|
||||
# env:
|
||||
# LOCAL_MAJOR_MINOR_VERSION: ${{ steps.local.outputs.version }}
|
||||
# REMOTE_VERSION: ${{ steps.remote.outputs.version }}
|
||||
# REMOTE_MAJOR_MINOR_VERSION: ${{ steps.mm.outputs.remote }}
|
||||
# REMOTE_SHA: ${{ steps.remote.outputs.sha }}
|
||||
# GO_VERSION: ${{ steps.go.outputs.go-version }}
|
||||
# GO_MAJOR_MINOR_VERSION: ${{ steps.mm.outputs.go }}
|
||||
# GITHUB_TOKEN: ${{ github.token }}
|
||||
# IMPLEMENTATION_DIRECTORY: ${{ matrix.test_name }}/impl/${{ matrix.implementation_name }}
|
||||
# VERSIONS_DIRECTORY: ${{ matrix.test_name == 'perf' && format('{0}/runner', matrix.test_name) || matrix.test_name }}
|
||||
# IMPLEMENTATION_NAME: ${{ matrix.implementation_name }}
|
||||
# REPOSITORY_NAME: ${{ matrix.repository_name }}
|
||||
# TEST_NAME: ${{ matrix.test_name }}
|
||||
# run: |
|
||||
# pushd $IMPLEMENTATION_DIRECTORY
|
||||
# cp -r $LOCAL_MAJOR_MINOR_VERSION $REMOTE_MAJOR_MINOR_VERSION
|
||||
# pushd $REMOTE_MAJOR_MINOR_VERSION
|
||||
# ${{ matrix.implementation_update_script }}
|
||||
# popd
|
||||
# popd
|
||||
jobs:
|
||||
add:
|
||||
name: Add new ${{ matrix.repository_name }} version to ${{ matrix.test_name }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- repository_name: go-libp2p
|
||||
implementation_name: go-libp2p
|
||||
test_name: perf
|
||||
implementation_update_script: |
|
||||
sed -i "1s/$LOCAL_MAJOR_MINOR_VERSION/$REMOTE_MAJOR_MINOR_VERSION/g" go.mod
|
||||
go mod tidy -go=$GO_MAJOR_MINOR_VERSION
|
||||
go mod tidy
|
||||
go get github.com/libp2p/go-libp2p@$REMOTE_VERSION
|
||||
- repository_name: go-libp2p
|
||||
implementation_name: go
|
||||
test_name: transport-interop
|
||||
implementation_update_script: |
|
||||
sed -i "s/image_name := go-${LOCAL_MAJOR_MINOR_VERSION}/image_name := go-${REMOTE_MAJOR_MINOR_VERSION}/g" Makefile
|
||||
sed -i "s/version := ${LOCAL_MAJOR_MINOR_VERSION#v}\..*/version := ${REMOTE_VERSION#v}/g" Makefile
|
||||
make version.lock
|
||||
- repository_name: rust-libp2p
|
||||
implementation_name: rust-libp2p
|
||||
test_name: perf
|
||||
implementation_update_script: |
|
||||
sed -i "s/commitSha := .*/commitSha := ${REMOTE_SHA}/g" Makefile
|
||||
- repository_name: rust-libp2p
|
||||
implementation_name: rust
|
||||
test_name: transport-interop
|
||||
implementation_update_script: |
|
||||
sed -i "s/image_name := rust-${LOCAL_MAJOR_MINOR_VERSION}/image_name := rust-${REMOTE_MAJOR_MINOR_VERSION}/g" Makefile
|
||||
sed -i "s/commitSha := .*/commitSha := ${REMOTE_SHA}/g" Makefile
|
||||
- repository_name: js-libp2p
|
||||
implementation_name: js-libp2p
|
||||
test_name: perf
|
||||
implementation_update_script: |
|
||||
suffix="$(echo "${REMOTE_MAJOR_MINOR_VERSION#v}" | sed 's/\./-/g')"
|
||||
sed -i "s/perf-js-libp2p-[^\"]*/perf-js-libp2p-$suffix/g" package.json
|
||||
npm install libp2p@$REMOTE_VERSION
|
||||
- repository_name: js-libp2p
|
||||
implementation_name: js
|
||||
test_name: transport-interop
|
||||
implementation_update_script: |
|
||||
sed -i "s/image_name := js-${LOCAL_MAJOR_MINOR_VERSION}\..*/image_name := js-${REMOTE_VERSION}/g" Makefile
|
||||
npm install libp2p@$REMOTE_VERSION
|
||||
env:
|
||||
BRANCH: add/${{ matrix.test_name }}/${{ matrix.repository_name }}
|
||||
steps:
|
||||
- name: Checkout test-plans
|
||||
uses: actions/checkout@v4
|
||||
- name: Configure git
|
||||
run: |
|
||||
git fetch origin $BRANCH && git checkout $BRANCH || git checkout -b $BRANCH
|
||||
git rebase $GITHUB_REF -X theirs || git rebase --abort
|
||||
git config --global user.email $GITHUB_ACTOR@users.noreply.github.com
|
||||
git config --global user.name $GITHUB_ACTOR
|
||||
- id: go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: stable
|
||||
- name: Get the latest version (local)
|
||||
id: local
|
||||
env:
|
||||
IMPLEMENTATION_DIRECTORY: ${{ matrix.test_name }}/impl/${{ matrix.implementation_name }}
|
||||
run: |
|
||||
pushd $IMPLEMENTATION_DIRECTORY
|
||||
ls -d v* | sort -V | tail -n-1 | xargs -I{} echo "version={}" | tee -a $GITHUB_OUTPUT
|
||||
popd
|
||||
- name: Get the latest version (remote)
|
||||
id: remote
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
REPOSITORY_NAME: ${{ matrix.repository_name }}
|
||||
run: |
|
||||
releases="$(gh api --paginate repos/libp2p/$REPOSITORY_NAME/releases)"
|
||||
latest="$(jq 'map(select(.tag_name | startswith("libp2p-"))) | first' <<< "$releases")"
|
||||
if [[ "$latest" == "null" ]]; then
|
||||
latest="$(jq 'first' <<< "$releases")"
|
||||
fi
|
||||
tag_name=$(jq -r '.tag_name' <<< "$latest")
|
||||
target_commitish=$(jq -r '.target_commitish' <<< "$latest")
|
||||
echo "version=${tag_name#libp2p-}" | tee -a $GITHUB_OUTPUT
|
||||
echo "target_commitish=${target_commitish}" | tee -a $GITHUB_OUTPUT
|
||||
- id: mm
|
||||
env:
|
||||
REMOTE_VERSION: ${{ steps.remote.outputs.version }}
|
||||
GO_VERSION: ${{ steps.go.outputs.go-version }}
|
||||
run: |
|
||||
echo $REMOTE_VERSION | sed 's/\.[0-9]*$//' | xargs -I{} echo "remote={}" | tee -a $GITHUB_OUTPUT
|
||||
echo $GO_VERSION | sed 's/\.[0-9]*$//' | xargs -I{} echo "go={}" | tee -a $GITHUB_OUTPUT
|
||||
- name: Add the latest version
|
||||
if: ${{ !startsWith(steps.remote.outputs.version, steps.local.outputs.version) }}
|
||||
env:
|
||||
LOCAL_MAJOR_MINOR_VERSION: ${{ steps.local.outputs.version }}
|
||||
REMOTE_VERSION: ${{ steps.remote.outputs.version }}
|
||||
REMOTE_MAJOR_MINOR_VERSION: ${{ steps.mm.outputs.remote }}
|
||||
REMOTE_SHA: ${{ steps.remote.outputs.sha }}
|
||||
GO_VERSION: ${{ steps.go.outputs.go-version }}
|
||||
GO_MAJOR_MINOR_VERSION: ${{ steps.mm.outputs.go }}
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
IMPLEMENTATION_DIRECTORY: ${{ matrix.test_name }}/impl/${{ matrix.implementation_name }}
|
||||
VERSIONS_DIRECTORY: ${{ matrix.test_name == 'perf' && format('{0}/runner', matrix.test_name) || matrix.test_name }}
|
||||
IMPLEMENTATION_NAME: ${{ matrix.implementation_name }}
|
||||
REPOSITORY_NAME: ${{ matrix.repository_name }}
|
||||
TEST_NAME: ${{ matrix.test_name }}
|
||||
run: |
|
||||
pushd $IMPLEMENTATION_DIRECTORY
|
||||
cp -r $LOCAL_MAJOR_MINOR_VERSION $REMOTE_MAJOR_MINOR_VERSION
|
||||
pushd $REMOTE_MAJOR_MINOR_VERSION
|
||||
${{ matrix.implementation_update_script }}
|
||||
popd
|
||||
popd
|
||||
|
||||
# pushd $VERSIONS_DIRECTORY
|
||||
# versions=''
|
||||
# if [[ "$TEST_NAME" == "perf" ]]; then
|
||||
# versions="$(jq '. + map(select(.implementation == env.IMPLEMENTATION_NAME and .id == env.LOCAL_MAJOR_MINOR_VERSION) | .id = env.REMOTE_MAJOR_MINOR_VERSION)' versionsInput.json)"
|
||||
# else
|
||||
# versions="$(jq '. + map(select(.id == "\(env.IMPLEMENTATION_NAME)-\(env.LOCAL_MAJOR_MINOR_VERSION)") | .id = "\(env.IMPLEMENTATION_NAME)-\(env.REMOTE_MAJOR_MINOR_VERSION)")' versionsInput.json)"
|
||||
# fi
|
||||
# echo "$versions" > versionsInput.json
|
||||
# popd
|
||||
pushd $VERSIONS_DIRECTORY
|
||||
versions=''
|
||||
if [[ "$TEST_NAME" == "perf" ]]; then
|
||||
versions="$(jq '. + map(select(.implementation == env.IMPLEMENTATION_NAME and .id == env.LOCAL_MAJOR_MINOR_VERSION) | .id = env.REMOTE_MAJOR_MINOR_VERSION)' versionsInput.json)"
|
||||
else
|
||||
versions="$(jq '. + map(select(.id == "\(env.IMPLEMENTATION_NAME)-\(env.LOCAL_MAJOR_MINOR_VERSION)") | .id = "\(env.IMPLEMENTATION_NAME)-\(env.REMOTE_MAJOR_MINOR_VERSION)")' versionsInput.json)"
|
||||
fi
|
||||
echo "$versions" > versionsInput.json
|
||||
popd
|
||||
|
||||
# git add .
|
||||
# git commit -m "chore: add $REPOSITORY_NAME@$REMOTE_VERSION to $TEST_NAME"
|
||||
git add .
|
||||
git commit -m "chore: add $REPOSITORY_NAME@$REMOTE_VERSION to $TEST_NAME"
|
||||
|
||||
# git push origin $BRANCH --force
|
||||
git push origin $BRANCH --force
|
||||
|
||||
# if [[ $(gh pr list --state open --base $GITHUB_REF --head $BRANCH | wc -l) -eq 0 ]]; then
|
||||
# gh pr create --title "chore: add $REPOSITORY_NAME@$REMOTE_VERSION to $TEST_NAME" --body "This PR adds $REPOSITORY_NAME@$REMOTE_VERSION to $TEST_NAME" --head $BRANCH --base $GITHUB_REF
|
||||
# fi
|
||||
if [[ $(gh pr list --state open --base $GITHUB_REF --head $BRANCH | wc -l) -eq 0 ]]; then
|
||||
gh pr create --title "chore: add $REPOSITORY_NAME@$REMOTE_VERSION to $TEST_NAME" --body "This PR adds $REPOSITORY_NAME@$REMOTE_VERSION to $TEST_NAME" --head $BRANCH --base $GITHUB_REF
|
||||
fi
|
||||
|
||||
# gh workflow run $TEST_NAME.yml --ref $BRANCH
|
||||
gh workflow run $TEST_NAME.yml --ref $BRANCH
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
# on:
|
||||
# workflow_dispatch:
|
||||
# pull_request:
|
||||
# paths:
|
||||
# - 'hole-punch-interop/**'
|
||||
# push:
|
||||
# branches:
|
||||
# - "master"
|
||||
# paths:
|
||||
# - 'hole-punch-interop/**'
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'hole-punch-interop/**'
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
paths:
|
||||
- 'hole-punch-interop/**'
|
||||
|
||||
# name: libp2p holepunching interop test
|
||||
name: libp2p holepunching interop test
|
||||
|
||||
# concurrency:
|
||||
# group: ${{ github.workflow }}-${{ github.ref }}
|
||||
# cancel-in-progress: true
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# jobs:
|
||||
# run-hole-punch-interop:
|
||||
# runs-on: ['self-hosted', 'linux', 'x64', '4xlarge'] # https://github.com/pl-strflt/tf-aws-gh-runner/blob/main/runners.tf
|
||||
# # Uncomment to test for flakiness.
|
||||
# # strategy:
|
||||
# # matrix:
|
||||
# # dim1: ['a', 'b', 'c', 'd', 'e']
|
||||
# # dim2: [1, 2, 3, 4, 5]
|
||||
# # fail-fast: false
|
||||
# steps:
|
||||
# - uses: actions/checkout@v3
|
||||
# - uses: ./.github/actions/run-interop-hole-punch-test
|
||||
# with:
|
||||
# s3-cache-bucket: libp2p-by-tf-aws-bootstrap
|
||||
# s3-access-key-id: ${{ vars.S3_AWS_ACCESS_KEY_ID }}
|
||||
# s3-secret-access-key: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY }}
|
||||
# worker-count: 16
|
||||
jobs:
|
||||
run-hole-punch-interop:
|
||||
runs-on: ['self-hosted', 'linux', 'x64', '4xlarge'] # https://github.com/pl-strflt/tf-aws-gh-runner/blob/main/runners.tf
|
||||
# Uncomment to test for flakiness.
|
||||
# strategy:
|
||||
# matrix:
|
||||
# dim1: ['a', 'b', 'c', 'd', 'e']
|
||||
# dim2: [1, 2, 3, 4, 5]
|
||||
# fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/run-interop-hole-punch-test
|
||||
with:
|
||||
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
|
||||
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
|
||||
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
|
||||
worker-count: 16
|
||||
|
||||
+101
-101
@@ -1,104 +1,104 @@
|
||||
# name: libp2p perf test
|
||||
name: libp2p perf test
|
||||
|
||||
# # How to configure a repository for running this workflow:
|
||||
# # 1. Configure auth for the AWS provider as per https://registry.terraform.io/providers/hashicorp/aws/latest/docs#authentication-and-configuration
|
||||
# # 2. Run 'terraform init' and 'terraform apply' in 'perf/terraform/configs/remote' to create the resources needed for this workflow
|
||||
# # 3. Go to https://console.aws.amazon.com/iamv2/home?#/users/details/perf?section=security_credentials
|
||||
# # 4. Click 'Create access key' to get the access key ID and secret access key
|
||||
# # 5. Go to https://github.com/libp2p/test-plans/settings/secrets/actions
|
||||
# # 6. Click 'New repository secret', set the name to 'PERF_AWS_SECRET_ACCESS_KEY', and paste the secret access key from step 5
|
||||
# # 7. Go to https://github.com/libp2p/test-plans/settings/variables/actions
|
||||
# # 8. Click 'New repository variable', set the name to 'PERF_AWS_ACCESS_KEY_ID', and paste the access key ID from step 5
|
||||
# How to configure a repository for running this workflow:
|
||||
# 1. Configure auth for the AWS provider as per https://registry.terraform.io/providers/hashicorp/aws/latest/docs#authentication-and-configuration
|
||||
# 2. Run 'terraform init' and 'terraform apply' in 'perf/terraform/configs/remote' to create the resources needed for this workflow
|
||||
# 3. Go to https://console.aws.amazon.com/iamv2/home?#/users/details/perf?section=security_credentials
|
||||
# 4. Click 'Create access key' to get the access key ID and secret access key
|
||||
# 5. Go to https://github.com/libp2p/test-plans/settings/secrets/actions
|
||||
# 6. Click 'New repository secret', set the name to 'PERF_AWS_SECRET_ACCESS_KEY', and paste the secret access key from step 5
|
||||
# 7. Go to https://github.com/libp2p/test-plans/settings/variables/actions
|
||||
# 8. Click 'New repository variable', set the name to 'PERF_AWS_ACCESS_KEY_ID', and paste the access key ID from step 5
|
||||
|
||||
# on:
|
||||
# workflow_dispatch:
|
||||
# inputs:
|
||||
# push:
|
||||
# description: 'Push the benchmark results to the repository'
|
||||
# required: false
|
||||
# default: 'true'
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
push:
|
||||
description: 'Push the benchmark results to the repository'
|
||||
required: false
|
||||
default: 'true'
|
||||
|
||||
# jobs:
|
||||
# perf:
|
||||
# name: Perf
|
||||
# runs-on: ubuntu-latest
|
||||
# timeout-minutes: 240
|
||||
# defaults:
|
||||
# run:
|
||||
# shell: bash
|
||||
# working-directory: perf
|
||||
# env:
|
||||
# AWS_ACCESS_KEY_ID: ${{ vars.PERF_AWS_ACCESS_KEY_ID }}
|
||||
# AWS_SECRET_ACCESS_KEY: ${{ secrets.PERF_AWS_SECRET_ACCESS_KEY }}
|
||||
# TF_IN_AUTOMATION: 1
|
||||
# TF_INPUT: 0
|
||||
# steps:
|
||||
# - name: Checkout test-plans
|
||||
# uses: actions/checkout@v3
|
||||
# with:
|
||||
# repository: ${{ github.repository }}
|
||||
# ref: ${{ github.ref }}
|
||||
# - id: ssh
|
||||
# name: Generate SSH key
|
||||
# run: |
|
||||
# make ssh-keygen
|
||||
# echo "key<<EOF" >> $GITHUB_OUTPUT
|
||||
# while read -r line; do
|
||||
# echo "::add-mask::$line"
|
||||
# echo "$line" >> $GITHUB_OUTPUT
|
||||
# done < terraform/modules/short_lived/files/perf
|
||||
# echo "EOF" >> $GITHUB_OUTPUT
|
||||
# - name: Configure SSH
|
||||
# uses: webfactory/ssh-agent@d4b9b8ff72958532804b70bbe600ad43b36d5f2e # v0.8.0
|
||||
# with:
|
||||
# ssh-private-key: ${{ steps.ssh.outputs.key }}
|
||||
# - name: Configure git
|
||||
# run: |
|
||||
# git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com>"
|
||||
# git config --global user.name "${GITHUB_ACTOR}"
|
||||
# - name: Configure terraform
|
||||
# uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
|
||||
# - name: Init terraform
|
||||
# id: init
|
||||
# run: terraform init
|
||||
# working-directory: perf/terraform/configs/local
|
||||
# - name: Apply terraform
|
||||
# run: terraform apply -auto-approve
|
||||
# working-directory: perf/terraform/configs/local
|
||||
# - id: server
|
||||
# name: Retrieve server's IP
|
||||
# run: terraform output -raw server_ip
|
||||
# working-directory: perf/terraform/configs/local
|
||||
# - id: client
|
||||
# name: Retrieve client's IP
|
||||
# run: terraform output -raw client_ip
|
||||
# working-directory: perf/terraform/configs/local
|
||||
# - name: Download dependencies
|
||||
# run: npm ci
|
||||
# working-directory: perf/runner
|
||||
# - name: Run tests
|
||||
# env:
|
||||
# SERVER_IP: ${{ steps.server.outputs.stdout }}
|
||||
# CLIENT_IP: ${{ steps.client.outputs.stdout }}
|
||||
# run: npm run start -- --client-public-ip $CLIENT_IP --server-public-ip $SERVER_IP
|
||||
# working-directory: perf/runner
|
||||
# - name: Push
|
||||
# if: github.event.inputs.push == 'true'
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ github.token }}
|
||||
# run: |
|
||||
# git add benchmark-results.json
|
||||
# git commit -m "perf: update benchmark results"
|
||||
# git push
|
||||
# gh pr comment --body "See new metrics at https://observablehq.com/@libp2p-workspace/performance-dashboard?branch=$(git rev-parse HEAD)" || true
|
||||
# working-directory: perf/runner
|
||||
# - name: Archive
|
||||
# if: github.event.intputs.push == 'false'
|
||||
# uses: actions/upload-artifact@v2
|
||||
# with:
|
||||
# name: benchmark-results
|
||||
# path: perf/runner/benchmark-results.json
|
||||
# - name: Destroy terraform
|
||||
# if: always() && steps.init.outputs.exitcode == 0
|
||||
# run: terraform destroy -auto-approve
|
||||
# working-directory: perf/terraform/configs/local
|
||||
jobs:
|
||||
perf:
|
||||
name: Perf
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 240
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: perf
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ vars.PERF_AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.PERF_AWS_SECRET_ACCESS_KEY }}
|
||||
TF_IN_AUTOMATION: 1
|
||||
TF_INPUT: 0
|
||||
steps:
|
||||
- name: Checkout test-plans
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ${{ github.repository }}
|
||||
ref: ${{ github.ref }}
|
||||
- id: ssh
|
||||
name: Generate SSH key
|
||||
run: |
|
||||
make ssh-keygen
|
||||
echo "key<<EOF" >> $GITHUB_OUTPUT
|
||||
while read -r line; do
|
||||
echo "::add-mask::$line"
|
||||
echo "$line" >> $GITHUB_OUTPUT
|
||||
done < terraform/modules/short_lived/files/perf
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
- name: Configure SSH
|
||||
uses: webfactory/ssh-agent@d4b9b8ff72958532804b70bbe600ad43b36d5f2e # v0.8.0
|
||||
with:
|
||||
ssh-private-key: ${{ steps.ssh.outputs.key }}
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com>"
|
||||
git config --global user.name "${GITHUB_ACTOR}"
|
||||
- name: Configure terraform
|
||||
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
|
||||
- name: Init terraform
|
||||
id: init
|
||||
run: terraform init
|
||||
working-directory: perf/terraform/configs/local
|
||||
- name: Apply terraform
|
||||
run: terraform apply -auto-approve
|
||||
working-directory: perf/terraform/configs/local
|
||||
- id: server
|
||||
name: Retrieve server's IP
|
||||
run: terraform output -raw server_ip
|
||||
working-directory: perf/terraform/configs/local
|
||||
- id: client
|
||||
name: Retrieve client's IP
|
||||
run: terraform output -raw client_ip
|
||||
working-directory: perf/terraform/configs/local
|
||||
- name: Download dependencies
|
||||
run: npm ci
|
||||
working-directory: perf/runner
|
||||
- name: Run tests
|
||||
env:
|
||||
SERVER_IP: ${{ steps.server.outputs.stdout }}
|
||||
CLIENT_IP: ${{ steps.client.outputs.stdout }}
|
||||
run: npm run start -- --client-public-ip $CLIENT_IP --server-public-ip $SERVER_IP
|
||||
working-directory: perf/runner
|
||||
- name: Push
|
||||
if: github.event.inputs.push == 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
git add benchmark-results.json
|
||||
git commit -m "perf: update benchmark results"
|
||||
git push
|
||||
gh pr comment --body "See new metrics at https://observablehq.com/@libp2p-workspace/performance-dashboard?branch=$(git rev-parse HEAD)" || true
|
||||
working-directory: perf/runner
|
||||
- name: Archive
|
||||
if: github.event.intputs.push == 'false'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: benchmark-results
|
||||
path: perf/runner/benchmark-results.json
|
||||
- name: Destroy terraform
|
||||
if: always() && steps.init.outputs.exitcode == 0
|
||||
run: terraform destroy -auto-approve
|
||||
working-directory: perf/terraform/configs/local
|
||||
|
||||
+10
-10
@@ -1,13 +1,13 @@
|
||||
# name: Close and mark stale issue
|
||||
name: Close and mark stale issue
|
||||
|
||||
# on:
|
||||
# schedule:
|
||||
# - cron: '0 0 * * *'
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
# permissions:
|
||||
# issues: write
|
||||
# pull-requests: write
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
# jobs:
|
||||
# stale:
|
||||
# uses: pl-strflt/.github/.github/workflows/reusable-stale-issue.yml@v0.3
|
||||
jobs:
|
||||
stale:
|
||||
uses: pl-strflt/.github/.github/workflows/reusable-stale-issue.yml@v0.3
|
||||
|
||||
@@ -13,64 +13,21 @@ name: libp2p transport interop test
|
||||
|
||||
jobs:
|
||||
run-transport-interop:
|
||||
# runs-on: ['self-hosted', 'linux', 'x64', '4xlarge'] # https://github.com/pl-strflt/tf-aws-gh-runner/blob/main/runners.tf
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ['self-hosted', 'linux', 'x64', '4xlarge'] # https://github.com/pl-strflt/tf-aws-gh-runner/blob/main/runners.tf
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/run-transport-interop-test
|
||||
with:
|
||||
s3-cache-bucket: libp2p-by-tf-aws-bootstrap
|
||||
s3-access-key-id: ${{ vars.S3_AWS_ACCESS_KEY_ID }}
|
||||
s3-secret-access-key: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY }}
|
||||
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
|
||||
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
|
||||
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
|
||||
worker-count: 16
|
||||
|
||||
# build-without-secrets:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v3
|
||||
# # Purposely not using secrets to replicate how forks will behave.
|
||||
# - uses: ./.github/actions/run-transport-interop-test
|
||||
# with:
|
||||
# # It's okay to not run the tests, we only care to check if the tests build without cache.
|
||||
|
||||
# test-filter: '"no test matches this, skip all"'
|
||||
|
||||
# build-docker-container-and-cache:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: Checkout repository
|
||||
# uses: actions/checkout@v3
|
||||
|
||||
# - name: Compute file hash
|
||||
# run: |
|
||||
# echo "Computing file hash"
|
||||
# # echo "File hash: ${{ hashFiles('**') }}"
|
||||
# ARCH=docker info -f "{{.Architecture}}"
|
||||
# echo $ARCH
|
||||
# ls /var/lib/docker
|
||||
|
||||
# # - name: Fetch cache
|
||||
# # uses: actions/cache@v4
|
||||
# # id: fetch-cache
|
||||
# # with:
|
||||
# # path: /tmp/cache
|
||||
# # key: ${{ runner.os }}-docker-${{ hashFiles('**') }}
|
||||
|
||||
# # - name: Build docker container
|
||||
# # if: steps.cache.outputs.cache-hit != 'true'
|
||||
# # id: docker-build
|
||||
# # run: |
|
||||
# # echo "Building docker container"
|
||||
|
||||
# # - name: Dump docker container
|
||||
# # if: steps.docker-build.conclusion == 'success'
|
||||
# # run: |
|
||||
# # echo "Dumping docker container"
|
||||
|
||||
# - name: Load docker container
|
||||
# run: |
|
||||
# echo "Loading docker container"
|
||||
|
||||
# - name: Hello world
|
||||
# run: |
|
||||
# echo "Hello, World!"
|
||||
build-without-secrets:
|
||||
runs-on: ['self-hosted', 'linux', 'x64', '4xlarge'] # https://github.com/pl-strflt/tf-aws-gh-runner/blob/main/runners.tf
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
# Purposely not using secrets to replicate how forks will behave.
|
||||
- uses: ./.github/actions/run-transport-interop-test
|
||||
with:
|
||||
# It's okay to not run the tests, we only care to check if the tests build without cache.
|
||||
test-filter: '"no test matches this, skip all"'
|
||||
|
||||
@@ -1,79 +1,79 @@
|
||||
# name: Update Badge
|
||||
name: Update Badge
|
||||
|
||||
# on:
|
||||
# workflow_run:
|
||||
# workflows:
|
||||
# - libp2p transport interop test
|
||||
# types:
|
||||
# - completed
|
||||
# branches:
|
||||
# - master
|
||||
on:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- libp2p transport interop test
|
||||
types:
|
||||
- completed
|
||||
branches:
|
||||
- master
|
||||
|
||||
# defaults:
|
||||
# run:
|
||||
# shell: bash
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
# concurrency:
|
||||
# group: ${{ github.workflow }}
|
||||
# cancel-in-progress: true
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# env:
|
||||
# BADGE_NAME: Interop Dashboard
|
||||
env:
|
||||
BADGE_NAME: Interop Dashboard
|
||||
|
||||
# jobs:
|
||||
# update-badge:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - id: workflow
|
||||
# env:
|
||||
# WORKFLOW_PATH: ${{ github.event.workflow.path }}
|
||||
# run: echo "name=${WORKFLOW_PATH#.github/workflows/}" >> $GITHUB_OUTPUT
|
||||
# - uses: pl-strflt/job-summary-url-action@v1
|
||||
# id: metadata
|
||||
# with:
|
||||
# workflow: ${{ steps.workflow.outputs.name }}
|
||||
# run_id: ${{ github.event.workflow_run.id }}
|
||||
# run_attempt: ${{ github.event.workflow_run.run_attempt }}
|
||||
# job: latest
|
||||
# - uses: actions/checkout@v3
|
||||
# - id: update
|
||||
# uses: actions/github-script@v6
|
||||
# env:
|
||||
# BADGE_URL: ${{ github.event.workflow.badge_url }}
|
||||
# SUMMARY_URL: ${{ steps.metadata.outputs.job_summary_url }}
|
||||
# with:
|
||||
# script: |
|
||||
# const fs = require('fs')
|
||||
jobs:
|
||||
update-badge:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: workflow
|
||||
env:
|
||||
WORKFLOW_PATH: ${{ github.event.workflow.path }}
|
||||
run: echo "name=${WORKFLOW_PATH#.github/workflows/}" >> $GITHUB_OUTPUT
|
||||
- uses: pl-strflt/job-summary-url-action@v1
|
||||
id: metadata
|
||||
with:
|
||||
workflow: ${{ steps.workflow.outputs.name }}
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
run_attempt: ${{ github.event.workflow_run.run_attempt }}
|
||||
job: latest
|
||||
- uses: actions/checkout@v3
|
||||
- id: update
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
BADGE_URL: ${{ github.event.workflow.badge_url }}
|
||||
SUMMARY_URL: ${{ steps.metadata.outputs.job_summary_url }}
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs')
|
||||
|
||||
# const badgeName = process.env.BADGE_NAME
|
||||
# const badgeURL = process.env.BADGE_URL
|
||||
# const refName = process.env.GITHUB_REF_NAME
|
||||
# const summaryURL = process.env.SUMMARY_URL
|
||||
const badgeName = process.env.BADGE_NAME
|
||||
const badgeURL = process.env.BADGE_URL
|
||||
const refName = process.env.GITHUB_REF_NAME
|
||||
const summaryURL = process.env.SUMMARY_URL
|
||||
|
||||
# const searchValue = new RegExp(`\\[!\\[${badgeName}\\]\\(.*\\)\\]\\(.*\\)`, 'g')
|
||||
# const replaceValue = `[](${summaryURL})`
|
||||
const searchValue = new RegExp(`\\[!\\[${badgeName}\\]\\(.*\\)\\]\\(.*\\)`, 'g')
|
||||
const replaceValue = `[](${summaryURL})`
|
||||
|
||||
# console.log(`Searching for: ${searchValue}`)
|
||||
# console.log(`To replace it with: ${replaceValue}`)
|
||||
console.log(`Searching for: ${searchValue}`)
|
||||
console.log(`To replace it with: ${replaceValue}`)
|
||||
|
||||
# const readme = fs.readFileSync('README.md').toString()
|
||||
# const updatedReadme = readme.replace(searchValue, replaceValue)
|
||||
const readme = fs.readFileSync('README.md').toString()
|
||||
const updatedReadme = readme.replace(searchValue, replaceValue)
|
||||
|
||||
# if (readme !== updatedReadme) {
|
||||
# console.log('Updating README')
|
||||
# fs.writeFileSync('README.md', updatedReadme)
|
||||
# return true
|
||||
# } else {
|
||||
# console.log('README does not need to be updated')
|
||||
# return false
|
||||
# }
|
||||
# # https://github.com/orgs/community/discussions/26560
|
||||
# - if: steps.update.outputs.result == 'true'
|
||||
# run: |
|
||||
# git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
# git config user.name "github-actions[bot]"
|
||||
# - if: steps.update.outputs.result == 'true'
|
||||
# run: |
|
||||
# git add README.md
|
||||
# git commit -m 'chore: update the link to the interop dashboard [skip ci]'
|
||||
# git push
|
||||
if (readme !== updatedReadme) {
|
||||
console.log('Updating README')
|
||||
fs.writeFileSync('README.md', updatedReadme)
|
||||
return true
|
||||
} else {
|
||||
console.log('README does not need to be updated')
|
||||
return false
|
||||
}
|
||||
# https://github.com/orgs/community/discussions/26560
|
||||
- if: steps.update.outputs.result == 'true'
|
||||
run: |
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git config user.name "github-actions[bot]"
|
||||
- if: steps.update.outputs.result == 'true'
|
||||
run: |
|
||||
git add README.md
|
||||
git commit -m 'chore: update the link to the interop dashboard [skip ci]'
|
||||
git push
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Interoperability/end to end test-plans & performance benchmarking for libp2p
|
||||
|
||||
[](https://github.com/status-im/libp2p-test-plans/actions/runs/7043365318/attempts/1#summary-19169013615)
|
||||
[](https://github.com/vacp2p/libp2p-test-plans/actions/runs/10508587062/attempts/1#summary-29112802717)
|
||||
|
||||
[](http://protocol.ai)
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"opRetro": {
|
||||
"projectId": "0x966804cb492e1a4bde5d781a676a44a23d69aa5dd2562fa7a4f95bb606021c8b"
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
const AWS_BUCKET = process.env.AWS_BUCKET || 'libp2p-by-tf-aws-bootstrap';
|
||||
const AWS_BUCKET = process.env.AWS_BUCKET;
|
||||
const scriptDir = __dirname;
|
||||
|
||||
import * as crypto from 'crypto';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as child_process from 'child_process';
|
||||
import ignore, { Ignore } from 'ignore'
|
||||
@@ -76,10 +77,14 @@ async function loadCacheOrBuild(dir: string, ig: Ignore) {
|
||||
if (mode == Mode.PushCache) {
|
||||
console.log("Pushing cache")
|
||||
try {
|
||||
const res = await fetch(`https://s3.amazonaws.com/${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz`, {method: "HEAD"})
|
||||
if (res.ok) {
|
||||
if (!AWS_BUCKET) {
|
||||
throw new Error("AWS_BUCKET not set")
|
||||
}
|
||||
try {
|
||||
child_process.execSync(`aws s3 ls s3://${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz`)
|
||||
console.log("Cache already exists")
|
||||
} else {
|
||||
} catch (e) {
|
||||
console.log("Cache doesn't exist", e)
|
||||
// Read image id from image.json
|
||||
const imageID = JSON.parse(fs.readFileSync(path.join(dir, 'image.json')).toString()).imageID;
|
||||
console.log(`Pushing cache for ${dir}: ${imageID}`)
|
||||
@@ -96,18 +101,17 @@ async function loadCacheOrBuild(dir: string, ig: Ignore) {
|
||||
console.log("Loading cache")
|
||||
let cacheHit = false
|
||||
try {
|
||||
// Check if the cache exists
|
||||
const res = await fetch(`https://s3.amazonaws.com/${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz`, {method: "HEAD"})
|
||||
if (res.ok) {
|
||||
const dockerLoadedMsg = child_process.execSync(`curl https://s3.amazonaws.com/${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz | docker image load`).toString();
|
||||
const loadedImageId = dockerLoadedMsg.match(/Loaded image( ID)?: (.*)/)[2];
|
||||
if (loadedImageId) {
|
||||
console.log(`Cache hit for ${loadedImageId}`);
|
||||
fs.writeFileSync(path.join(dir, 'image.json'), JSON.stringify({imageID: loadedImageId}) + "\n");
|
||||
cacheHit = true
|
||||
}
|
||||
} else {
|
||||
console.log("Cache not found")
|
||||
if (!AWS_BUCKET) {
|
||||
throw new Error("AWS_BUCKET not set")
|
||||
}
|
||||
const cachePath = fs.mkdtempSync(path.join(os.tmpdir(), 'cache'))
|
||||
const archivePath = path.join(cachePath, 'archive.tar.gz')
|
||||
const dockerLoadedMsg = child_process.execSync(`aws s3 cp s3://${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz ${archivePath} && docker image load -i ${archivePath}`).toString();
|
||||
const loadedImageId = dockerLoadedMsg.match(/Loaded image( ID)?: (.*)/)[2];
|
||||
if (loadedImageId) {
|
||||
console.log(`Cache hit for ${loadedImageId}`);
|
||||
fs.writeFileSync(path.join(dir, 'image.json'), JSON.stringify({imageID: loadedImageId}) + "\n");
|
||||
cacheHit = true
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Cache not found:", e)
|
||||
|
||||
@@ -2,15 +2,11 @@
|
||||
|
||||
CACHING_OPTIONS=""
|
||||
# If in CI and we have a defined cache bucket, use caching
|
||||
# if [[ -n "${CI}" ]] && [[ -n "${AWS_BUCKET}" ]]; then
|
||||
# CACHING_OPTIONS="\
|
||||
# --cache-to type=s3,mode=max,bucket=$AWS_BUCKET,region=$AWS_REGION,prefix=buildCache,name=$IMAGE_NAME \
|
||||
# --cache-from type=s3,mode=max,bucket=$AWS_BUCKET,region=$AWS_REGION,prefix=buildCache,name=$IMAGE_NAME"
|
||||
# fi
|
||||
|
||||
CACHING_OPTIONS="\
|
||||
--cache-to type=gha,mode=max \
|
||||
--cache-from type=gha,mode=max"
|
||||
if [[ -n "${CI}" ]] && [[ -n "${AWS_BUCKET}" ]]; then
|
||||
CACHING_OPTIONS="\
|
||||
--cache-to type=s3,mode=max,bucket=$AWS_BUCKET,region=$AWS_REGION,prefix=buildCache,name=$IMAGE_NAME \
|
||||
--cache-from type=s3,mode=max,bucket=$AWS_BUCKET,region=$AWS_REGION,prefix=buildCache,name=$IMAGE_NAME"
|
||||
fi
|
||||
|
||||
docker buildx build \
|
||||
--load \
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
const AWS_BUCKET = process.env.AWS_BUCKET || 'libp2p-by-tf-aws-bootstrap';
|
||||
const AWS_BUCKET = process.env.AWS_BUCKET;
|
||||
const scriptDir = __dirname;
|
||||
|
||||
import * as crypto from 'crypto';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as child_process from 'child_process';
|
||||
import ignore, { Ignore } from 'ignore'
|
||||
@@ -65,10 +66,14 @@ switch (modeStr) {
|
||||
if (mode == Mode.PushCache) {
|
||||
console.log("Pushing cache")
|
||||
try {
|
||||
const res = await fetch(`https://s3.amazonaws.com/${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz`, { method: "HEAD" })
|
||||
if (res.ok) {
|
||||
if (!AWS_BUCKET) {
|
||||
throw new Error("AWS_BUCKET not set")
|
||||
}
|
||||
try {
|
||||
child_process.execSync(`aws s3 ls s3://${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz`)
|
||||
console.log("Cache already exists")
|
||||
} else {
|
||||
} catch (e) {
|
||||
console.log("Cache doesn't exist", e)
|
||||
// Read image id from image.json
|
||||
const imageID = JSON.parse(fs.readFileSync(path.join(implFolder, 'image.json')).toString()).imageID;
|
||||
console.log(`Pushing cache for ${impl}: ${imageID}`)
|
||||
@@ -85,18 +90,17 @@ switch (modeStr) {
|
||||
console.log("Loading cache")
|
||||
let cacheHit = false
|
||||
try {
|
||||
// Check if the cache exists
|
||||
const res = await fetch(`https://s3.amazonaws.com/${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz`, { method: "HEAD" })
|
||||
if (res.ok) {
|
||||
const dockerLoadedMsg = child_process.execSync(`curl https://s3.amazonaws.com/${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz | docker image load`).toString();
|
||||
const loadedImageId = dockerLoadedMsg.match(/Loaded image( ID)?: (.*)/)[2];
|
||||
if (loadedImageId) {
|
||||
console.log(`Cache hit for ${loadedImageId}`);
|
||||
fs.writeFileSync(path.join(implFolder, 'image.json'), JSON.stringify({ imageID: loadedImageId }) + "\n");
|
||||
cacheHit = true
|
||||
}
|
||||
} else {
|
||||
console.log("Cache not found")
|
||||
if (!AWS_BUCKET) {
|
||||
throw new Error("AWS_BUCKET not set")
|
||||
}
|
||||
const cachePath = fs.mkdtempSync(path.join(os.tmpdir(), 'cache'))
|
||||
const archivePath = path.join(cachePath, 'archive.tar.gz')
|
||||
const dockerLoadedMsg = child_process.execSync(`aws s3 cp s3://${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz ${archivePath} && docker image load -i ${archivePath}`).toString();
|
||||
const loadedImageId = dockerLoadedMsg.match(/Loaded image( ID)?: (.*)/)[2];
|
||||
if (loadedImageId) {
|
||||
console.log(`Cache hit for ${loadedImageId}`);
|
||||
fs.writeFileSync(path.join(implFolder, 'image.json'), JSON.stringify({ imageID: loadedImageId }) + "\n");
|
||||
cacheHit = true
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Cache not found:", e)
|
||||
|
||||
@@ -18,10 +18,10 @@ go-libp2p-${version}.zip:
|
||||
# This locks the exact contents of the specified version. This lets us use the
|
||||
# human readable name while still making sure the contents don't change.
|
||||
version.lock: go-libp2p-${version}.zip
|
||||
sha256sum go-libp2p-${version}.zip > $@
|
||||
shasum -a 256 go-libp2p-${version}.zip > $@
|
||||
|
||||
verify-checksum: go-libp2p-${version}.zip
|
||||
sha256sum -c version.lock
|
||||
shasum -a 256 -c version.lock
|
||||
|
||||
.PHONY: clean all verify-checksum
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@ go-libp2p-${version}.zip:
|
||||
# This locks the exact contents of the specified version. This lets us use the
|
||||
# human readable name while still making sure the contents don't change.
|
||||
version.lock: go-libp2p-${version}.zip
|
||||
sha256sum go-libp2p-${version}.zip > $@
|
||||
shasum -a 256 go-libp2p-${version}.zip > $@
|
||||
|
||||
verify-checksum: go-libp2p-${version}.zip
|
||||
sha256sum -c version.lock
|
||||
shasum -a 256 -c version.lock
|
||||
|
||||
.PHONY: clean all verify-checksum
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@ go-libp2p-${version}.zip:
|
||||
# This locks the exact contents of the specified version. This lets us use the
|
||||
# human readable name while still making sure the contents don't change.
|
||||
version.lock: go-libp2p-${version}.zip
|
||||
sha256sum go-libp2p-${version}.zip > $@
|
||||
shasum -a 256 go-libp2p-${version}.zip > $@
|
||||
|
||||
verify-checksum: go-libp2p-${version}.zip
|
||||
sha256sum -c version.lock
|
||||
shasum -a 256 -c version.lock
|
||||
|
||||
.PHONY: clean all verify-checksum
|
||||
|
||||
|
||||
Reference in New Issue
Block a user