use local sshd config #9
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
name: Benchmark Test | |
on: | |
push: | |
branches: [ '*' ] | |
pull_request: | |
branches: [ '*' ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build_wolfssl: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest ] | |
wolfssl: [ master ] | |
name: Build wolfssl | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 4 | |
steps: | |
- name: Checking cache for wolfssl | |
uses: actions/cache@v4 | |
id: cache-wolfssl | |
with: | |
path: build-dir/ | |
key: wolfssh-sshd-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }} | |
lookup-only: true | |
- name: Checkout, build, and install wolfssl | |
if: steps.cache-wolfssl.outputs.cache-hit != 'true' | |
uses: wolfSSL/actions-build-autotools-project@v1 | |
with: | |
repository: wolfssl/wolfssl | |
ref: ${{ matrix.wolfssl }} | |
path: wolfssl | |
configure: --enable-all | |
check: false | |
install: true | |
build_wolfssh: | |
needs: | |
- build_wolfssl | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest ] | |
wolfssl: [ master ] | |
name: Build and test wolfsshd | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 10 | |
steps: | |
- name: Checking cache for wolfssl | |
uses: actions/cache@v4 | |
with: | |
path: build-dir/ | |
key: wolfssh-sshd-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }} | |
fail-on-cache-miss: true | |
- uses: actions/checkout@v4 | |
with: | |
path: wolfssh/ | |
- name: autogen | |
working-directory: ./wolfssh/ | |
run: ./autogen.sh | |
- name: configure | |
working-directory: ./wolfssh/ | |
run : | | |
./configure --enable-all LDFLAGS="-L${{ github.workspace }}/build-dir/lib" CPPFLAGS="-I${{ github.workspace }}/build-dir/include -DWOLFSSH_NO_FPKI -DWOLFSSH_NO_SFTP_TIMEOUT -DWOLFSSH_MAX_SFTP_RW=4000000 -DMAX_PATH_SZ=120 -DEXAMPLE_SFTP_BENCHMARK" | |
- name: make | |
working-directory: ./wolfssh/ | |
run: make | |
- name: Get Saved OpenSSH Upload Results | |
uses: actions/download-artifact@v4 | |
continue-on-error: true | |
with: | |
path: ./wolfssh/ | |
artifact_id: 'openssh-upload' | |
- name: Get Saved OpenSSH Download Results | |
uses: actions/download-artifact@v4 | |
continue-on-error: true | |
with: | |
path: ./wolfssh/ | |
artifact_id: 'openssh-download' | |
- name: Put test key in authorized keys file | |
working-directory: ./wolfssh/ | |
run: | | |
mkdir ~/.ssh | |
touch ~/.ssh/authorized_keys | |
touch authorized_keys_test | |
echo "AuthorizedKeysFile wolfssh/keys/hansel-key-ecc.pub" >> sshd-config-test.txt | |
echo "PubkeyAuthentication yes" >> sshd-config-test.txt | |
chmod 600 ./keys/hansel-key-*.pem | |
sudo mkdir -p /run/sshd | |
sudo chmod 755 /run/sshd | |
sudo /usr/sbin/sshd -p 22222 -h $PWD/keys/server-key.pem -f sshd-config-test.txt | |
- name: Run SFTP client benchmark | |
working-directory: ./wolfssh/ | |
run: | | |
./scripts/get-sftp-benchmark.sh 22222 | |
- name: Store Upload Speed PNG | |
uses: actions/upload-artifact@v4 | |
with: | |
name: upload-results-pr${{ github.event.pull_request.number }}.png | |
path: wolfssh/upload-results.png | |
retention-days: 2 | |
- name: Store Download Speed PNG | |
uses: actions/upload-artifact@v4 | |
with: | |
name: download-results-pr${{ github.event.pull_request.number }}.png | |
path: wolfssh/download-results.png | |
retention-days: 2 | |
- name: Upload OpenSSH Download Results | |
if: steps.download-artifact.outputs.found != 'true' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: openssh-download | |
path: wolfssh/openssh-average-download.csv | |
- name: Upload OpenSSH Upload Results | |
if: steps.download-artifact.outputs.found != 'true' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: openssh-upload | |
path: wolfssh/openssh-average-upload.csv | |
- name: Comment on PR about performance | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") | |
gh pr comment $PR_NUMBER --body "Attached is the performance results" \ | |
--attach download-results-pr${{ github.event.pull_request.number }}.png \ | |
--attach upload-results-pr${{ github.event.pull_request.number }}.png |