-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run makefile tests for every sample in a separate CI workflow #247
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "[email protected]" | ||
git config --global user.name "Localstack Pro-Samples" | ||
# - name: Setup config | ||
# run: | | ||
# echo "Configuring git for codecommit sample" | ||
# git config --global user.email "[email protected]" | ||
# 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 }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/,$//')]" | ||
Comment on lines
+10
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a pretty dangerous approach, because it does not limit the amount of parallel runners at all. GitHub organizations have a limit of 20 concurrent Linux runners for free in public repos: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration |
||
|
||
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 "[email protected]" | ||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we are commenting the whole file out, why not just remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that would be removed once I have an explicit approval that this is the way to go forward 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, with git being used properly and everywhere, there is never a need for commented out code. You can always jump back, and commented code can't make it into code reviews or even in the mainline (where it just causes confusion and maintenance overhead - also for example like these comments here 😛).