From 8cb70b09fd0683980f56cd7ebd92fa664ed1b1bf Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 22 Aug 2024 12:05:24 +0200 Subject: [PATCH] Check for variables --- .../run-transport-interop-test/action.yml | 108 ++++++++++-------- .github/workflows/transport-interop.yml | 88 +++++++------- 2 files changed, 103 insertions(+), 93 deletions(-) diff --git a/.github/actions/run-transport-interop-test/action.yml b/.github/actions/run-transport-interop-test/action.yml index e7d95fd..513ecdd 100644 --- a/.github/actions/run-transport-interop-test/action.yml +++ b/.github/actions/run-transport-interop-test/action.yml @@ -37,14 +37,22 @@ runs: using: "composite" steps: - - 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 + - name: Get values + run: | + echo ${{ github.api_url }} + echo ${{ github.event_name }} + echo ${{ github.repository }} + echo ${{ github.repositoryUrl }} + echo ${github.token:0:4}$(printf '%*s' $((${#secret}-4)) | tr ' ' '*') + + # - 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 >----- @@ -54,8 +62,8 @@ runs: # echo "PUSH_CACHE=true" >> $GITHUB_ENV # shell: bash - # This depends on where this file is within this repository. This walks up - # from here to the transport-interop folder + # # This depends on where this file is within this repository. This walks up + # # from here to the transport-interop folder # - run: | # WORK_DIR=$(realpath "$GITHUB_ACTION_PATH/../../../transport-interop") # echo "WORK_DIR=$WORK_DIR" >> $GITHUB_OUTPUT @@ -66,10 +74,10 @@ runs: # with: # node-version: 18 - # Existence of /etc/buildkit/buildkitd.toml indicates that this is a - # self-hosted runner. If so, we need to pass the config to the buildx - # action. The config enables docker.io proxy which is required to - # work around docker hub rate limiting. + # # Existence of /etc/buildkit/buildkitd.toml indicates that this is a + # # self-hosted runner. If so, we need to pass the config to the buildx + # # action. The config enables docker.io proxy which is required to + # # work around docker hub rate limiting. # - run: | # if test -f /etc/buildkit/buildkitd.toml; then # echo "config=/etc/buildkit/buildkitd.toml" >> $GITHUB_OUTPUT @@ -116,44 +124,44 @@ runs: # -----< 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 diff --git a/.github/workflows/transport-interop.yml b/.github/workflows/transport-interop.yml index 00967c0..967a123 100644 --- a/.github/workflows/transport-interop.yml +++ b/.github/workflows/transport-interop.yml @@ -12,16 +12,17 @@ on: 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 - # 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 }} - # worker-count: 16 + run-transport-interop: + 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 }} + worker-count: 16 + # build-without-secrets: # runs-on: ubuntu-latest # steps: @@ -32,42 +33,43 @@ jobs: # # 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 + + # 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: 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: 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: 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: Dump docker container + # # if: steps.docker-build.conclusion == 'success' + # # run: | + # # echo "Dumping docker container" - - name: Load docker container - run: | - echo "Loading docker container" + # - name: Load docker container + # run: | + # echo "Loading docker container" - - name: Hello world - run: | - echo "Hello, World!" + # - name: Hello world + # run: | + # echo "Hello, World!"