From 7a8424697b166db132318dad36b449ae355165f8 Mon Sep 17 00:00:00 2001 From: HarshCasper Date: Mon, 3 Jun 2024 23:23:16 +0530 Subject: [PATCH 1/4] take a stab --- .github/workflows/makefile.yml | 110 ++++++++++++++++----------------- .github/workflows/test.yml | 41 ++++++++++++ 2 files changed, 96 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index d2a2fb66..9b9ff648 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -1,64 +1,64 @@ -name: Makefile CI +# name: Makefile CI -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - schedule: - - cron: '0 13 * * 1' -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 +# on: +# push: +# branches: [ "master" ] +# pull_request: +# branches: [ "master" ] +# schedule: +# - cron: '0 13 * * 1' +# jobs: +# test: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v3 - - name: Setup Nodejs - uses: actions/setup-node@v3 - with: - node-version: 14 +# - name: Setup Nodejs +# uses: actions/setup-node@v3 +# with: +# node-version: 14 - # see https://github.com/localstack/localstack/pull/6831 - # remove once no longer needed - - name: Fix pyOpenSSL version - run: pip install --upgrade pyOpenSSL +# # see https://github.com/localstack/localstack/pull/6831 +# # remove once no longer needed +# - name: Fix pyOpenSSL version +# run: pip install --upgrade pyOpenSSL - - name: Install LocalStack - run: pip install localstack awscli-local[ver1] +# - name: Install LocalStack +# run: pip install localstack awscli-local[ver1] - - name: Install Dependencies - run: | - pip install virtualenv - pip install --upgrade pyopenssl - npm install -g serverless +# - name: Install Dependencies +# run: | +# pip install virtualenv +# pip install --upgrade pyopenssl +# npm install -g serverless - - name: Setup config - run: | - echo "Configuring git for codecommit sample" - git config --global user.email "localstack.sample@localstack.cloud" - git config --global user.name "Localstack Pro-Samples" +# - name: Setup config +# run: | +# echo "Configuring git for codecommit sample" +# git config --global user.email "localstack.sample@localstack.cloud" +# git config --global user.name "Localstack Pro-Samples" - - name: Pull the latest docker image - run: docker pull localstack/localstack-pro +# - name: Pull the latest docker image +# run: docker pull localstack/localstack-pro - - name: Execute tests - env: - LOCALSTACK_API_KEY: ${{ secrets.TEST_LOCALSTACK_API_KEY }} - DNS_ADDRESS: 127.0.0.1 - DEBUG: 1 - timeout-minutes: 200 - run: make test-ci-all +# - name: Execute tests +# env: +# LOCALSTACK_API_KEY: ${{ secrets.TEST_LOCALSTACK_API_KEY }} +# DNS_ADDRESS: 127.0.0.1 +# DEBUG: 1 +# timeout-minutes: 200 +# run: make test-ci-all - - name: Send a Slack notification - if: failure() || github.event_name != 'pull_request' - uses: ravsamhq/notify-slack-action@v2 - with: - status: ${{ job.status }} - token: ${{ secrets.GITHUB_TOKEN }} - notification_title: "{workflow} has {status_message}" - message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>" - footer: "Linked Repo <{repo_url}|{repo}> | <{run_url}|View Workflow run>" - notify_when: "failure" - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} +# - name: Send a Slack notification +# if: failure() || github.event_name != 'pull_request' +# uses: ravsamhq/notify-slack-action@v2 +# with: +# status: ${{ job.status }} +# token: ${{ secrets.GITHUB_TOKEN }} +# notification_title: "{workflow} has {status_message}" +# message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>" +# footer: "Linked Repo <{repo_url}|{repo}> | <{run_url}|View Workflow run>" +# notify_when: "failure" +# env: +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..b8176511 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +name: "Run Tests for all samples" + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + prepare_list: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - id: set-matrix + run: | + echo "matrix=[$(find . -type f -name 'Makefile' ! -path './sample-archive/*' | sed 's|/Makefile||' | awk '{printf "\"%s\",", $1}' | sed 's/,$//')]" >> $GITHUB_OUTPUT + - run: echo "matrix=[$(find . -type f -name 'Makefile' ! -path './sample-archive/*' | sed 's|/Makefile||' | awk '{printf "\"%s\",", $1}' | sed 's/,$//')]" + + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + + runtest: + name: Run Dependency Test + runs-on: ubuntu-latest + needs: prepare_list + strategy: + fail-fast: false + matrix: + directory: ${{ fromJson(needs.prepare_list.outputs.matrix) }} + + steps: + - uses: actions/checkout@v4 + - name: Change to Directory + run: cd ${{ matrix.directory }} + - name: Execute a simple test + run: | + ls -a + pwd + env: + AWS_ACCESS_KEY_ID: key + AWS_SECRET_ACCESS_KEY: secret From 9925caac64bf99436098dce40673b6afc0f1cd90 Mon Sep 17 00:00:00 2001 From: HarshCasper Date: Mon, 3 Jun 2024 23:29:59 +0530 Subject: [PATCH 2/4] run actual tests now --- .github/workflows/test.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b8176511..e74a9051 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,12 +30,25 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Change to Directory - run: cd ${{ matrix.directory }} + - name: Setup Nodejs + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install LocalStack + run: pip install localstack awscli-local[ver1] virtualenv + - name: Setup config + run: | + echo "Configuring git for codecommit sample" + git config --global user.email "localstack.sample@localstack.cloud" + git config --global user.name "Localstack Pro-Samples" + - name: Pull the latest docker image + run: docker pull localstack/localstack-pro - name: Execute a simple test + timeout-minutes: 10 run: | - ls -a - pwd + cd ${{ matrix.directory }} + make test-ci env: - AWS_ACCESS_KEY_ID: key - AWS_SECRET_ACCESS_KEY: secret + LOCALSTACK_API_KEY: ${{ secrets.TEST_LOCALSTACK_API_KEY }} + DEBUG: 1 + DNS_ADDRESS: 127.0.0.1 From 07a281c7d7295dd8caad24ceb3c23914f3bfd24e Mon Sep 17 00:00:00 2001 From: HarshCasper Date: Mon, 3 Jun 2024 23:39:51 +0530 Subject: [PATCH 3/4] set mindepth to 2: --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e74a9051..8015bd32 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,8 @@ jobs: - uses: actions/checkout@v4 - id: set-matrix run: | - echo "matrix=[$(find . -type f -name 'Makefile' ! -path './sample-archive/*' | sed 's|/Makefile||' | awk '{printf "\"%s\",", $1}' | sed 's/,$//')]" >> $GITHUB_OUTPUT - - run: echo "matrix=[$(find . -type f -name 'Makefile' ! -path './sample-archive/*' | sed 's|/Makefile||' | awk '{printf "\"%s\",", $1}' | sed 's/,$//')]" + echo "matrix=[$(find . -mindepth 2 -type f -name 'Makefile' ! -path './sample-archive/*' | sed 's|/Makefile||' | awk '{printf "\"%s\",", $1}' | sed 's/,$//')]" >> $GITHUB_OUTPUT + - run: echo "matrix=[$(find . -mindepth 2 -type f -name 'Makefile' ! -path './sample-archive/*' | sed 's|/Makefile||' | awk '{printf "\"%s\",", $1}' | sed 's/,$//')]" outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} From b68381666afe093ac2e91c972a901eac31b5d4ca Mon Sep 17 00:00:00 2001 From: Harsh Mishra Date: Thu, 5 Mar 2026 21:42:29 +0530 Subject: [PATCH 4/4] fix comments --- .github/workflows/makefile.yml | 64 ---------------------------------- .github/workflows/test.yml | 37 +++++++++++--------- 2 files changed, 20 insertions(+), 81 deletions(-) delete mode 100644 .github/workflows/makefile.yml diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml deleted file mode 100644 index 9b9ff648..00000000 --- a/.github/workflows/makefile.yml +++ /dev/null @@ -1,64 +0,0 @@ -# name: Makefile CI - -# on: -# push: -# branches: [ "master" ] -# pull_request: -# branches: [ "master" ] -# schedule: -# - cron: '0 13 * * 1' -# jobs: -# test: -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v3 - -# - name: Setup Nodejs -# uses: actions/setup-node@v3 -# with: -# node-version: 14 - -# # see https://github.com/localstack/localstack/pull/6831 -# # remove once no longer needed -# - name: Fix pyOpenSSL version -# run: pip install --upgrade pyOpenSSL - -# - name: Install LocalStack -# run: pip install localstack awscli-local[ver1] - -# - name: Install Dependencies -# run: | -# pip install virtualenv -# pip install --upgrade pyopenssl -# npm install -g serverless - -# - name: Setup config -# run: | -# echo "Configuring git for codecommit sample" -# git config --global user.email "localstack.sample@localstack.cloud" -# git config --global user.name "Localstack Pro-Samples" - -# - name: Pull the latest docker image -# run: docker pull localstack/localstack-pro - -# - name: Execute tests -# env: -# LOCALSTACK_API_KEY: ${{ secrets.TEST_LOCALSTACK_API_KEY }} -# DNS_ADDRESS: 127.0.0.1 -# DEBUG: 1 -# timeout-minutes: 200 -# run: make test-ci-all - -# - name: Send a Slack notification -# if: failure() || github.event_name != 'pull_request' -# uses: ravsamhq/notify-slack-action@v2 -# with: -# status: ${{ job.status }} -# token: ${{ secrets.GITHUB_TOKEN }} -# notification_title: "{workflow} has {status_message}" -# message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>" -# footer: "Linked Repo <{repo_url}|{repo}> | <{run_url}|View Workflow run>" -# notify_when: "failure" -# env: -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8015bd32..30a6a6e3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,41 +1,44 @@ -name: "Run Tests for all samples" +name: Run tests for all samples on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] + push: + branches: + - master + pull_request: + branches: + - master jobs: - prepare_list: + prepare-list: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - id: set-matrix run: | - echo "matrix=[$(find . -mindepth 2 -type f -name 'Makefile' ! -path './sample-archive/*' | sed 's|/Makefile||' | awk '{printf "\"%s\",", $1}' | sed 's/,$//')]" >> $GITHUB_OUTPUT - - run: echo "matrix=[$(find . -mindepth 2 -type f -name 'Makefile' ! -path './sample-archive/*' | sed 's|/Makefile||' | awk '{printf "\"%s\",", $1}' | sed 's/,$//')]" + mapfile -t dirs < <(find . -mindepth 2 -type f -name "Makefile" ! -path "./sample-archive/*" | sed "s|/Makefile||" | sort) + echo "matrix=$(printf '%s\n' "${dirs[@]}" | jq -R . | jq -cs .)" >> "$GITHUB_OUTPUT" outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} - runtest: - name: Run Dependency Test + run-tests: + name: Run dependency test (${{ matrix.directory }}) runs-on: ubuntu-latest - needs: prepare_list + needs: prepare-list strategy: fail-fast: false + max-parallel: 8 matrix: - directory: ${{ fromJson(needs.prepare_list.outputs.matrix) }} - + directory: ${{ fromJSON(needs.prepare-list.outputs.matrix) }} + steps: - uses: actions/checkout@v4 - - name: Setup Nodejs - uses: actions/setup-node@v3 + - name: Setup Node.js + uses: actions/setup-node@v4 with: node-version: 18 - name: Install LocalStack - run: pip install localstack awscli-local[ver1] virtualenv + run: pip install localstack awscli-local[ver1] virtualenv - name: Setup config run: | echo "Configuring git for codecommit sample" @@ -49,6 +52,6 @@ jobs: cd ${{ matrix.directory }} make test-ci env: - LOCALSTACK_API_KEY: ${{ secrets.TEST_LOCALSTACK_API_KEY }} + LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} DEBUG: 1 DNS_ADDRESS: 127.0.0.1