diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index d2a2fb6..9b9ff64 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 0000000..8015bd3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,54 @@ +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 . -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 }} + + 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: 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: | + cd ${{ matrix.directory }} + make test-ci + env: + LOCALSTACK_API_KEY: ${{ secrets.TEST_LOCALSTACK_API_KEY }} + DEBUG: 1 + DNS_ADDRESS: 127.0.0.1