From bb1b007d46c4a08b27960d1699786e8ecbd46edd Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 04:59:28 +0000 Subject: [PATCH 01/19] add if --- .github/workflows/test-server-all.yml | 374 ++++++++++++++------------ 1 file changed, 195 insertions(+), 179 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index d9678dac7..41403600a 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -30,37 +30,53 @@ jobs: cd ${{ github.workspace }}/packages/server/ make check - small_test_cc: + search_change_file_names: runs-on: ubuntu-latest needs: [lint] + outputs: + change_file_names: ${{ steps.output_step.outputs.file_names}} steps: - - name: Checkout - uses: actions/checkout@v2 - - # Setup config for using GCS as bazel remote cache - - name: Update GCP service account JSON - run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json - env: - CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} - - - name: Update .bazelrc for using remote cache - run: | - eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc - env: - BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} - - - name: Build images and run computation_container - run: make test t=./computation_container m=build p=small - working-directory: ./scripts - - - name: Run bazel test in computation_container - run: make test t=./computation_container m=run p=small - working-directory: ./scripts + - name: Get changed files + id: get_changed-files + uses: tj-actions/changed-files@v35 + + -name: + id: output_step + run: echo "file_names=${{ steps.changed-files.outputs.all_changed_files }}" >> "$GITHUB_OUTPUT" + + # small_test_cc: + # runs-on: ubuntu-latest + # needs: [lint] + + # steps: + # - name: Checkout + # uses: actions/checkout@v2 + + # # Setup config for using GCS as bazel remote cache + # - name: Update GCP service account JSON + # run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json + # env: + # CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} + + # - name: Update .bazelrc for using remote cache + # run: | + # eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc + # env: + # BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} + + # - name: Build images and run computation_container + # run: make test t=./computation_container m=build p=small + # working-directory: ./scripts + + # - name: Run bazel test in computation_container + # run: make test t=./computation_container m=run p=small + # working-directory: ./scripts small_test_mc: runs-on: ubuntu-latest - needs: [lint] + needs: [lint, search_change_file_names] + if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") steps: - name: Checkout @@ -74,158 +90,158 @@ jobs: run: make test t=./manage_container m=run p=small working-directory: ./scripts - small_test_bts: - runs-on: ubuntu-latest - needs: [lint] - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Build beaver_triple_service binary - run: make test t=./beaver_triple_service m=build - working-directory: ./scripts - - - name: Run test in beaver_triple_service - run: make test t=./beaver_triple_service m=run - working-directory: ./scripts - - small_test: - runs-on: ubuntu-latest - needs: [lint, small_test_cc, small_test_mc, small_test_bts] - - steps: - - name: Merge All small_test - run: echo "ok" - - medium_test_cc: - runs-on: ubuntu-latest - needs: [lint] - steps: - - name: Checkout - uses: actions/checkout@v2 - - # Setup config for using GCS as bazel remote cache - - name: Update GCP service account JSON - run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json - env: - CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} - - - name: Update .bazelrc for using remote cache - run: | - eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc - env: - BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} - - - name: Log into registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin - - - name: Build images and run computation_container - run: make test t=./computation_container m=build p=medium - working-directory: ./scripts - - - name: Run bazel test in computation_container - run: make test t=./computation_container m=run p=medium - working-directory: ./scripts - - medium_test_mc: - runs-on: ubuntu-latest - needs: [lint] - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Build images and run manage_container - run: make test t=./manage_container m=build p=medium - working-directory: ./scripts - - - name: Run bazel test in manage_container - run: make test t=./manage_container m=run p=medium - working-directory: ./scripts - - medium_test_libclient: - runs-on: ubuntu-latest - needs: [lint] - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }} - submodules: true - - - name: Update GCP service account JSON - run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json - env: - CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} - - - name: Update .bazelrc for using remote cache - run: | - eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc - env: - BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} - - - name: Log into registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin - - - name: Build images and run libclient - run: make test t=./libclient m=build p=medium - working-directory: ./scripts - - - name: Run bazel test in libclient - run: make test t=./libclient m=run p=medium - working-directory: ./scripts - - medium_test_container: - runs-on: ubuntu-latest - needs: [lint] - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }} - submodules: true - - - name: Update GCP service account JSON - run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json - env: - CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} - - - name: Update .bazelrc for using remote cache - run: | - eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc - env: - BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} - - - name: Log into registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin - - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Build container test images - run: | - pip install pipenv - make test t=./container_test m=build p=medium - working-directory: ./scripts - - - name: Run container test - run: make test t=./container_test m=run p=medium - working-directory: ./scripts - medium_test: - runs-on: ubuntu-latest - needs: - [ - lint, - medium_test_cc, - medium_test_mc, - medium_test_libclient, - medium_test_container, - ] - - steps: - - name: Merge All medium_test - run: echo "ok" + # small_test_bts: + # runs-on: ubuntu-latest + # needs: [lint] + + # steps: + # - name: Checkout + # uses: actions/checkout@v2 + + # - name: Build beaver_triple_service binary + # run: make test t=./beaver_triple_service m=build + # working-directory: ./scripts + + # - name: Run test in beaver_triple_service + # run: make test t=./beaver_triple_service m=run + # working-directory: ./scripts + + # small_test: + # runs-on: ubuntu-latest + # needs: [lint, small_test_cc, small_test_mc, small_test_bts] + + # steps: + # - name: Merge All small_test + # run: echo "ok" + + # medium_test_cc: + # runs-on: ubuntu-latest + # needs: [lint] + # steps: + # - name: Checkout + # uses: actions/checkout@v2 + + # # Setup config for using GCS as bazel remote cache + # - name: Update GCP service account JSON + # run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json + # env: + # CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} + + # - name: Update .bazelrc for using remote cache + # run: | + # eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc + # env: + # BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} + + # - name: Log into registry + # run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin + + # - name: Build images and run computation_container + # run: make test t=./computation_container m=build p=medium + # working-directory: ./scripts + + # - name: Run bazel test in computation_container + # run: make test t=./computation_container m=run p=medium + # working-directory: ./scripts + + # medium_test_mc: + # runs-on: ubuntu-latest + # needs: [lint] + # steps: + # - name: Checkout + # uses: actions/checkout@v2 + + # - name: Build images and run manage_container + # run: make test t=./manage_container m=build p=medium + # working-directory: ./scripts + + # - name: Run bazel test in manage_container + # run: make test t=./manage_container m=run p=medium + # working-directory: ./scripts + + # medium_test_libclient: + # runs-on: ubuntu-latest + # needs: [lint] + # steps: + # - name: Checkout + # uses: actions/checkout@v2 + # with: + # fetch-depth: 0 + # token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }} + # submodules: true + + # - name: Update GCP service account JSON + # run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json + # env: + # CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} + + # - name: Update .bazelrc for using remote cache + # run: | + # eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc + # env: + # BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} + + # - name: Log into registry + # run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin + + # - name: Build images and run libclient + # run: make test t=./libclient m=build p=medium + # working-directory: ./scripts + + # - name: Run bazel test in libclient + # run: make test t=./libclient m=run p=medium + # working-directory: ./scripts + + # medium_test_container: + # runs-on: ubuntu-latest + # needs: [lint] + # steps: + # - name: Checkout + # uses: actions/checkout@v2 + # with: + # fetch-depth: 0 + # token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }} + # submodules: true + + # - name: Update GCP service account JSON + # run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json + # env: + # CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} + + # - name: Update .bazelrc for using remote cache + # run: | + # eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc + # env: + # BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} + + # - name: Log into registry + # run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin + + # - name: Set up Python 3.7 + # uses: actions/setup-python@v2 + # with: + # python-version: 3.7 + + # - name: Build container test images + # run: | + # pip install pipenv + # make test t=./container_test m=build p=medium + # working-directory: ./scripts + + # - name: Run container test + # run: make test t=./container_test m=run p=medium + # working-directory: ./scripts + # medium_test: + # runs-on: ubuntu-latest + # needs: + # [ + # lint, + # medium_test_cc, + # medium_test_mc, + # medium_test_libclient, + # medium_test_container, + # ] + + # steps: + # - name: Merge All medium_test + # run: echo "ok" From 81ebcd0410b55ee5f91d5d0c5789097c5b558a65 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:00:21 +0000 Subject: [PATCH 02/19] typo --- .github/workflows/test-server-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 41403600a..13567ec05 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -41,7 +41,7 @@ jobs: id: get_changed-files uses: tj-actions/changed-files@v35 - -name: + - name: Output id: output_step run: echo "file_names=${{ steps.changed-files.outputs.all_changed_files }}" >> "$GITHUB_OUTPUT" From 8c7b9a02b203942ced2d924e378814456a5618f7 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:05:21 +0000 Subject: [PATCH 03/19] checkout --- .github/workflows/test-server-all.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 13567ec05..ced89882c 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -37,6 +37,10 @@ jobs: change_file_names: ${{ steps.output_step.outputs.file_names}} steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Get changed files id: get_changed-files uses: tj-actions/changed-files@v35 From 2eeb890feab418f84fcdb6f2e85db1800a0bdf18 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:10:01 +0000 Subject: [PATCH 04/19] position of if --- .github/workflows/test-server-all.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index ced89882c..968a339a0 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -80,17 +80,18 @@ jobs: small_test_mc: runs-on: ubuntu-latest needs: [lint, search_change_file_names] - if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") - steps: - name: Checkout + if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") uses: actions/checkout@v2 - name: Build images and run manage_container + if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") run: make test t=./manage_container m=build p=small working-directory: ./scripts - name: Run Go test in manage_container + if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") run: make test t=./manage_container m=run p=small working-directory: ./scripts From 68a6703c538e6db7d0e573a39c72437ffe42ac96 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:15:42 +0000 Subject: [PATCH 05/19] echo --- .github/workflows/test-server-all.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 968a339a0..06e199ad5 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -95,6 +95,9 @@ jobs: run: make test t=./manage_container m=run p=small working-directory: ./scripts + - name: Echo + run: echo "${{needs.search_change_file_names.outputs.change_file_names}}" + # small_test_bts: # runs-on: ubuntu-latest # needs: [lint] From 4022f60bd08cc84b063c86f765449b0cfa484360 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:21:11 +0000 Subject: [PATCH 06/19] delete kakko --- .github/workflows/test-server-all.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 06e199ad5..a51579303 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -85,18 +85,18 @@ jobs: if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") uses: actions/checkout@v2 - - name: Build images and run manage_container - if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") - run: make test t=./manage_container m=build p=small - working-directory: ./scripts + # - name: Build images and run manage_container + # if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") + # run: make test t=./manage_container m=build p=small + # working-directory: ./scripts - - name: Run Go test in manage_container - if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") - run: make test t=./manage_container m=run p=small - working-directory: ./scripts + # - name: Run Go test in manage_container + # if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") + # run: make test t=./manage_container m=run p=small + # working-directory: ./scripts - name: Echo - run: echo "${{needs.search_change_file_names.outputs.change_file_names}}" + run: echo ${{needs.search_change_file_names.outputs.change_file_names}} # small_test_bts: # runs-on: ubuntu-latest From bef437f79b74d1a94ff2c333fda5053a41d219a3 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:24:35 +0000 Subject: [PATCH 07/19] fix --- .github/workflows/test-server-all.yml | 41 +++++++++++++-------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index a51579303..64fd32b18 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -12,29 +12,28 @@ env: COMPOSE_DOCKER_CLI_BUILD: 1 jobs: - lint: - runs-on: ubuntu-latest + # lint: + # runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install clang-format tool - run: | - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 14 - sudo apt-get update - sudo apt-get install clang-format-14 - - name: Check if *.{cpp|hpp} files are formatted - run: | - cd ${{ github.workspace }}/packages/server/ - make check + # steps: + # - name: Checkout + # uses: actions/checkout@v2 + # - name: Install clang-format tool + # run: | + # wget https://apt.llvm.org/llvm.sh + # chmod +x llvm.sh + # sudo ./llvm.sh 14 + # sudo apt-get update + # sudo apt-get install clang-format-14 + # - name: Check if *.{cpp|hpp} files are formatted + # run: | + # cd ${{ github.workspace }}/packages/server/ + # make check search_change_file_names: runs-on: ubuntu-latest - needs: [lint] outputs: - change_file_names: ${{ steps.output_step.outputs.file_names}} + change_file_names: ${{ steps.output_step.outputs.file_names }} steps: - uses: actions/checkout@v3 @@ -42,12 +41,12 @@ jobs: fetch-depth: 0 - name: Get changed files - id: get_changed-files + id: get_changed_files uses: tj-actions/changed-files@v35 - name: Output id: output_step - run: echo "file_names=${{ steps.changed-files.outputs.all_changed_files }}" >> "$GITHUB_OUTPUT" + run: echo "file_names=${{ steps.get_changed_files.outputs.all_changed_files }}" >> "$GITHUB_OUTPUT" # small_test_cc: # runs-on: ubuntu-latest @@ -79,7 +78,7 @@ jobs: small_test_mc: runs-on: ubuntu-latest - needs: [lint, search_change_file_names] + needs: [search_change_file_names] steps: - name: Checkout if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") From 3181194e46a222b21aa9bac4739d9f5752a0ea51 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:27:00 +0000 Subject: [PATCH 08/19] add "" --- .github/workflows/test-server-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 64fd32b18..0f1cfc7c1 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -81,7 +81,7 @@ jobs: needs: [search_change_file_names] steps: - name: Checkout - if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") + if: contains("${{needs.search_change_file_names.outputs.change_file_names}}", "manage_container") uses: actions/checkout@v2 # - name: Build images and run manage_container From 1a3f0649e496850b30935a47ec830600c514a417 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:28:56 +0000 Subject: [PATCH 09/19] add hoge --- .github/workflows/test-server-all.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 0f1cfc7c1..551c5f893 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -80,9 +80,9 @@ jobs: runs-on: ubuntu-latest needs: [search_change_file_names] steps: - - name: Checkout - if: contains("${{needs.search_change_file_names.outputs.change_file_names}}", "manage_container") - uses: actions/checkout@v2 + # - name: Checkout + # if: contains("${{needs.search_change_file_names.outputs.change_file_names}}", "manage_container") + # uses: actions/checkout@v2 # - name: Build images and run manage_container # if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") @@ -94,6 +94,10 @@ jobs: # run: make test t=./manage_container m=run p=small # working-directory: ./scripts + - name: hoge + if: contains("${{needs.search_change_file_names.outputs.change_file_names}}", "manage_container") + run: echo "Hello World!" + - name: Echo run: echo ${{needs.search_change_file_names.outputs.change_file_names}} From 89171e66b74555e883d5b35d237a012313ccf5d4 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:38:00 +0000 Subject: [PATCH 10/19] " -> ' --- .github/workflows/test-server-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 551c5f893..bc558c3b9 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -95,7 +95,7 @@ jobs: # working-directory: ./scripts - name: hoge - if: contains("${{needs.search_change_file_names.outputs.change_file_names}}", "manage_container") + if: contains('${{needs.search_change_file_names.outputs.change_file_names}}', 'manage_container') run: echo "Hello World!" - name: Echo From 77e4fedc16d35e03f5b2690dae5d85ba36ce2429 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:40:10 +0000 Subject: [PATCH 11/19] ${{}} del --- .github/workflows/test-server-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index bc558c3b9..a87f17f3c 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -95,7 +95,7 @@ jobs: # working-directory: ./scripts - name: hoge - if: contains('${{needs.search_change_file_names.outputs.change_file_names}}', 'manage_container') + if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') run: echo "Hello World!" - name: Echo From bd1f5cecf639a1bcdc4edce85dc06d19325d8b0a Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:42:33 +0000 Subject: [PATCH 12/19] comment del --- .github/workflows/test-server-all.yml | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index a87f17f3c..decfb295d 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -80,26 +80,19 @@ jobs: runs-on: ubuntu-latest needs: [search_change_file_names] steps: - # - name: Checkout - # if: contains("${{needs.search_change_file_names.outputs.change_file_names}}", "manage_container") - # uses: actions/checkout@v2 - - # - name: Build images and run manage_container - # if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") - # run: make test t=./manage_container m=build p=small - # working-directory: ./scripts - - # - name: Run Go test in manage_container - # if: contains(${{needs.search_change_file_names.outputs.change_file_names}}, "manage_container") - # run: make test t=./manage_container m=run p=small - # working-directory: ./scripts + - name: Checkout + if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') + uses: actions/checkout@v2 - - name: hoge + - name: Build images and run manage_container if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') - run: echo "Hello World!" + run: make test t=./manage_container m=build p=small + working-directory: ./scripts - - name: Echo - run: echo ${{needs.search_change_file_names.outputs.change_file_names}} + - name: Run Go test in manage_container + if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') + run: make test t=./manage_container m=run p=small + working-directory: ./scripts # small_test_bts: # runs-on: ubuntu-latest From cb386f60c0416253f9cf1f4e4e7305b9ccf6df53 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:44:09 +0000 Subject: [PATCH 13/19] change position --- .github/workflows/test-server-all.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index decfb295d..3be844157 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -79,18 +79,19 @@ jobs: small_test_mc: runs-on: ubuntu-latest needs: [search_change_file_names] + if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') steps: - name: Checkout - if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') + # if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') uses: actions/checkout@v2 - name: Build images and run manage_container - if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') + # if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') run: make test t=./manage_container m=build p=small working-directory: ./scripts - name: Run Go test in manage_container - if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') + # if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') run: make test t=./manage_container m=run p=small working-directory: ./scripts From a029a42082e25281d8120efc0301f01f5278b6d2 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:45:18 +0000 Subject: [PATCH 14/19] change README --- packages/server/manage_container/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/manage_container/README.md b/packages/server/manage_container/README.md index 97f91eab3..65268d85a 100644 --- a/packages/server/manage_container/README.md +++ b/packages/server/manage_container/README.md @@ -1,5 +1,5 @@ Manage Container -==== +=== ## 使用方法 ### イメージを構築 From 47897abce1972084f6863f3a40be6875fc058dcb Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:55:05 +0000 Subject: [PATCH 15/19] add all --- .github/workflows/test-server-all.yml | 410 +++++++++++++------------- 1 file changed, 208 insertions(+), 202 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 3be844157..ee0b20f54 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -12,28 +12,29 @@ env: COMPOSE_DOCKER_CLI_BUILD: 1 jobs: - # lint: - # runs-on: ubuntu-latest - - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - # - name: Install clang-format tool - # run: | - # wget https://apt.llvm.org/llvm.sh - # chmod +x llvm.sh - # sudo ./llvm.sh 14 - # sudo apt-get update - # sudo apt-get install clang-format-14 - # - name: Check if *.{cpp|hpp} files are formatted - # run: | - # cd ${{ github.workspace }}/packages/server/ - # make check - - search_change_file_names: + lint: runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install clang-format tool + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 14 + sudo apt-get update + sudo apt-get install clang-format-14 + - name: Check if *.{cpp|hpp} files are formatted + run: | + cd ${{ github.workspace }}/packages/server/ + make check + + change_files: + runs-on: ubuntu-latest + needs: [lint] outputs: - change_file_names: ${{ steps.output_step.outputs.file_names }} + file_names: ${{ steps.output_step.outputs.file_names }} steps: - uses: actions/checkout@v3 @@ -48,205 +49,210 @@ jobs: id: output_step run: echo "file_names=${{ steps.get_changed_files.outputs.all_changed_files }}" >> "$GITHUB_OUTPUT" - # small_test_cc: - # runs-on: ubuntu-latest - # needs: [lint] - - # steps: - # - name: Checkout - # uses: actions/checkout@v2 + small_test_cc: + runs-on: ubuntu-latest + needs: [lint,change_files] + if: contains( needs.change_files.outputs.file_names, 'computation_container') + steps: + - name: Checkout + uses: actions/checkout@v2 - # # Setup config for using GCS as bazel remote cache - # - name: Update GCP service account JSON - # run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json - # env: - # CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} + # Setup config for using GCS as bazel remote cache + - name: Update GCP service account JSON + run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json + env: + CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} - # - name: Update .bazelrc for using remote cache - # run: | - # eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc - # env: - # BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} + - name: Update .bazelrc for using remote cache + run: | + eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc + env: + BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} - # - name: Build images and run computation_container - # run: make test t=./computation_container m=build p=small - # working-directory: ./scripts + - name: Build images and run computation_container + run: make test t=./computation_container m=build p=small + working-directory: ./scripts - # - name: Run bazel test in computation_container - # run: make test t=./computation_container m=run p=small - # working-directory: ./scripts + - name: Run bazel test in computation_container + run: make test t=./computation_container m=run p=small + working-directory: ./scripts small_test_mc: runs-on: ubuntu-latest needs: [search_change_file_names] - if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') + if: contains( needs.change_files.outputs.file_names, 'manage_container') steps: - name: Checkout - # if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') uses: actions/checkout@v2 - name: Build images and run manage_container - # if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') run: make test t=./manage_container m=build p=small working-directory: ./scripts - name: Run Go test in manage_container - # if: contains( needs.search_change_file_names.outputs.change_file_names, 'manage_container') run: make test t=./manage_container m=run p=small working-directory: ./scripts - # small_test_bts: - # runs-on: ubuntu-latest - # needs: [lint] - - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - - # - name: Build beaver_triple_service binary - # run: make test t=./beaver_triple_service m=build - # working-directory: ./scripts - - # - name: Run test in beaver_triple_service - # run: make test t=./beaver_triple_service m=run - # working-directory: ./scripts - - # small_test: - # runs-on: ubuntu-latest - # needs: [lint, small_test_cc, small_test_mc, small_test_bts] - - # steps: - # - name: Merge All small_test - # run: echo "ok" - - # medium_test_cc: - # runs-on: ubuntu-latest - # needs: [lint] - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - - # # Setup config for using GCS as bazel remote cache - # - name: Update GCP service account JSON - # run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json - # env: - # CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} - - # - name: Update .bazelrc for using remote cache - # run: | - # eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc - # env: - # BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} - - # - name: Log into registry - # run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin - - # - name: Build images and run computation_container - # run: make test t=./computation_container m=build p=medium - # working-directory: ./scripts - - # - name: Run bazel test in computation_container - # run: make test t=./computation_container m=run p=medium - # working-directory: ./scripts - - # medium_test_mc: - # runs-on: ubuntu-latest - # needs: [lint] - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - - # - name: Build images and run manage_container - # run: make test t=./manage_container m=build p=medium - # working-directory: ./scripts - - # - name: Run bazel test in manage_container - # run: make test t=./manage_container m=run p=medium - # working-directory: ./scripts - - # medium_test_libclient: - # runs-on: ubuntu-latest - # needs: [lint] - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - # with: - # fetch-depth: 0 - # token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }} - # submodules: true - - # - name: Update GCP service account JSON - # run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json - # env: - # CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} - - # - name: Update .bazelrc for using remote cache - # run: | - # eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc - # env: - # BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} - - # - name: Log into registry - # run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin - - # - name: Build images and run libclient - # run: make test t=./libclient m=build p=medium - # working-directory: ./scripts - - # - name: Run bazel test in libclient - # run: make test t=./libclient m=run p=medium - # working-directory: ./scripts - - # medium_test_container: - # runs-on: ubuntu-latest - # needs: [lint] - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - # with: - # fetch-depth: 0 - # token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }} - # submodules: true - - # - name: Update GCP service account JSON - # run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json - # env: - # CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} - - # - name: Update .bazelrc for using remote cache - # run: | - # eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc - # env: - # BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} - - # - name: Log into registry - # run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin - - # - name: Set up Python 3.7 - # uses: actions/setup-python@v2 - # with: - # python-version: 3.7 - - # - name: Build container test images - # run: | - # pip install pipenv - # make test t=./container_test m=build p=medium - # working-directory: ./scripts - - # - name: Run container test - # run: make test t=./container_test m=run p=medium - # working-directory: ./scripts - # medium_test: - # runs-on: ubuntu-latest - # needs: - # [ - # lint, - # medium_test_cc, - # medium_test_mc, - # medium_test_libclient, - # medium_test_container, - # ] - - # steps: - # - name: Merge All medium_test - # run: echo "ok" + small_test_bts: + runs-on: ubuntu-latest + needs: [lint,change_files] + if: contains( needs.change_files.outputs.file_names, 'beaver_triple_service') + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Build beaver_triple_service binary + run: make test t=./beaver_triple_service m=build + working-directory: ./scripts + + - name: Run test in beaver_triple_service + run: make test t=./beaver_triple_service m=run + working-directory: ./scripts + + small_test: + runs-on: ubuntu-latest + needs: [lint, small_test_cc, small_test_mc, small_test_bts] + + steps: + - name: Merge All small_test + run: echo "ok" + + medium_test_cc: + runs-on: ubuntu-latest + needs: [lint,change_files] + if: | + ${{ + contains( needs.change_files.outputs.file_names, 'computation_container') || + contains( needs.change_files.outputs.file_names, 'beaver_triple_service') + }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + # Setup config for using GCS as bazel remote cache + - name: Update GCP service account JSON + run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json + env: + CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} + + - name: Update .bazelrc for using remote cache + run: | + eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc + env: + BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} + + - name: Log into registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin + + - name: Build images and run computation_container + run: make test t=./computation_container m=build p=medium + working-directory: ./scripts + + - name: Run bazel test in computation_container + run: make test t=./computation_container m=run p=medium + working-directory: ./scripts + + medium_test_mc: + runs-on: ubuntu-latest + needs: [lint,change_files] + if: contains( needs.change_files.outputs.file_names, 'manage_container') + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Build images and run manage_container + run: make test t=./manage_container m=build p=medium + working-directory: ./scripts + + - name: Run bazel test in manage_container + run: make test t=./manage_container m=run p=medium + working-directory: ./scripts + + medium_test_libclient: + runs-on: ubuntu-latest + needs: [lint,change_files] + if: contains( needs.change_files.outputs.file_names, 'packages') + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }} + submodules: true + + - name: Update GCP service account JSON + run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json + env: + CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} + + - name: Update .bazelrc for using remote cache + run: | + eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc + env: + BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} + + - name: Log into registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin + + - name: Build images and run libclient + run: make test t=./libclient m=build p=medium + working-directory: ./scripts + + - name: Run bazel test in libclient + run: make test t=./libclient m=run p=medium + working-directory: ./scripts + + medium_test_container: + runs-on: ubuntu-latest + needs: [lint,change_files] + if: contains( needs.change_files.outputs.file_names, 'packages') + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }} + submodules: true + + - name: Update GCP service account JSON + run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json + env: + CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} + + - name: Update .bazelrc for using remote cache + run: | + eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc + env: + BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} + + - name: Log into registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin + + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Build container test images + run: | + pip install pipenv + make test t=./container_test m=build p=medium + working-directory: ./scripts + + - name: Run container test + run: make test t=./container_test m=run p=medium + working-directory: ./scripts + medium_test: + runs-on: ubuntu-latest + needs: + [ + lint, + medium_test_cc, + medium_test_mc, + medium_test_libclient, + medium_test_container, + ] + + steps: + - name: Merge All medium_test + run: echo "ok" From 53dce6963e6aaa9f42a9fb0d0913c54c2b73d6d6 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 05:55:50 +0000 Subject: [PATCH 16/19] typo --- .github/workflows/test-server-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index ee0b20f54..2837af35b 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -79,7 +79,7 @@ jobs: small_test_mc: runs-on: ubuntu-latest - needs: [search_change_file_names] + needs: [change_files] if: contains( needs.change_files.outputs.file_names, 'manage_container') steps: - name: Checkout From 8f1453f0784a92983968e3cc80938ba90ca2c86a Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 06:13:25 +0000 Subject: [PATCH 17/19] fix --- .github/workflows/test-server-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 2837af35b..6b690d508 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -205,7 +205,7 @@ jobs: medium_test_container: runs-on: ubuntu-latest needs: [lint,change_files] - if: contains( needs.change_files.outputs.file_names, 'packages') + if: contains( needs.change_files.outputs.file_names, 'packages/server') steps: - name: Checkout uses: actions/checkout@v2 From b81c8ee033ac423587fd8140c85f59361090d66e Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 06:14:51 +0000 Subject: [PATCH 18/19] lint --- .github/workflows/test-server-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 6b690d508..2f71470ac 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -79,7 +79,7 @@ jobs: small_test_mc: runs-on: ubuntu-latest - needs: [change_files] + needs: [lint,change_files] if: contains( needs.change_files.outputs.file_names, 'manage_container') steps: - name: Checkout From 911a78beaa7398bae000b5ff331f7d17442a19c3 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Thu, 11 May 2023 06:17:54 +0000 Subject: [PATCH 19/19] if multi --- .github/workflows/test-server-all.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 2f71470ac..8e981e60b 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -121,10 +121,8 @@ jobs: runs-on: ubuntu-latest needs: [lint,change_files] if: | - ${{ - contains( needs.change_files.outputs.file_names, 'computation_container') || - contains( needs.change_files.outputs.file_names, 'beaver_triple_service') - }} + contains( needs.change_files.outputs.file_names, 'computation_container') || + contains( needs.change_files.outputs.file_names, 'beaver_triple_service') steps: - name: Checkout uses: actions/checkout@v2