Skip to content

Commit afd962e

Browse files
committed
feat(ci): add matrix os choice
1 parent 59be277 commit afd962e

File tree

1 file changed

+84
-69
lines changed

1 file changed

+84
-69
lines changed

.github/workflows/integration-test.yml

Lines changed: 84 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -17,87 +17,102 @@ on:
1717
- cron: "0 0 * * 0"
1818
workflow_dispatch:
1919
inputs:
20-
runner-os:
21-
default: ubuntu-latest
22-
type: choice
23-
options:
24-
- ubuntu-latest
25-
- macos-latest
20+
ubuntu-latest:
21+
type: boolean
22+
default: true
23+
macos-latest:
24+
type: boolean
25+
default: false
2626

2727

2828
jobs:
29+
get-selected-os:
30+
runs-on: ubuntu-latest
31+
outputs: # This needs to be set if you want to consume the output on another job
32+
os-runners: ${{ steps.get-selected-os.outputs.selected }}
33+
steps:
34+
- name: Get selected runner OS
35+
id: get-selected-os
36+
run: >
37+
os-runners=$(jq -cr "map_values(. // empty) | keys" <<< '${{ toJson(inputs) }}') >> $GITHUB_OUTPUT
38+
2939
run-it-tests-job:
30-
runs-on: ${{ inputs.runner-os || 'ubuntu-latest' }}
40+
needs: get-selected-os
41+
strategy:
42+
matrix:
43+
os: ${{ fromJSON(needs.get-selected-os.outputs.os-runners) }}
44+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
3145
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v2
46+
- run: echo '${{ needs.get-selected-os.outputs.os-runners }}'
47+
# - name: Checkout
48+
# uses: actions/checkout@v2
3449

35-
- name: Set up Python 3.11
36-
id: setup-python
37-
uses: actions/setup-python@v2
38-
with:
39-
python-version: 3.11
50+
# - name: Set up Python 3.11
51+
# id: setup-python
52+
# uses: actions/setup-python@v2
53+
# with:
54+
# python-version: 3.11
4055

41-
- name: Docker setup (macos only)
42-
id: setup-docker-mac
43-
if: ${{ runner.os == 'macOS' }}
44-
run: |
45-
brew install docker
46-
colima start
56+
# - name: Docker setup (macos only)
57+
# id: setup-docker-mac
58+
# if: ${{ runner.os == 'macOS' }}
59+
# run: |
60+
# brew install docker
61+
# colima start
4762

48-
- name: Set up Project
49-
run: |
50-
pip install -r requirements-dev.txt
63+
# - name: Set up Project
64+
# run: |
65+
# pip install -r requirements-dev.txt
5166

52-
- name: Start LocalStack
53-
uses: LocalStack/setup-localstack@v0.2.0
54-
with:
55-
image-tag: 'latest'
56-
use-pro: 'true'
57-
configuration: LS_LOG=trace
58-
install-awslocal: 'true'
59-
env:
60-
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
67+
# - name: Start LocalStack
68+
# uses: LocalStack/setup-localstack@v0.2.0
69+
# with:
70+
# image-tag: 'latest'
71+
# use-pro: 'true'
72+
# configuration: LS_LOG=trace
73+
# install-awslocal: 'true'
74+
# env:
75+
# LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
6176

62-
- name: Deploy infrastructure
63-
run: |
64-
bin/deploy.sh
77+
# - name: Deploy infrastructure
78+
# run: |
79+
# bin/deploy.sh
6580

66-
- name: Run Tests
67-
env:
68-
AWS_DEFAULT_REGION: us-east-1
69-
AWS_REGION: us-east-1
70-
AWS_ACCESS_KEY_ID: test
71-
AWS_SECRET_ACCESS_KEY: test
72-
run: |
73-
pytest tests
81+
# - name: Run Tests
82+
# env:
83+
# AWS_DEFAULT_REGION: us-east-1
84+
# AWS_REGION: us-east-1
85+
# AWS_ACCESS_KEY_ID: test
86+
# AWS_SECRET_ACCESS_KEY: test
87+
# run: |
88+
# pytest tests
7489

75-
- name: Show localstack logs
76-
if: always()
77-
run: |
78-
localstack logs
90+
# - name: Show localstack logs
91+
# if: always()
92+
# run: |
93+
# localstack logs
7994

80-
- name: Send a Slack notification
81-
if: failure() || github.event_name != 'pull_request'
82-
uses: ravsamhq/notify-slack-action@v2
83-
with:
84-
status: ${{ job.status }}
85-
token: ${{ secrets.GITHUB_TOKEN }}
86-
notification_title: "{workflow} has {status_message}"
87-
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
88-
footer: "Linked Repo <{repo_url}|{repo}> | <{run_url}|View Workflow run>"
89-
notify_when: "failure"
90-
env:
91-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
95+
# - name: Send a Slack notification
96+
# if: failure() || github.event_name != 'pull_request'
97+
# uses: ravsamhq/notify-slack-action@v2
98+
# with:
99+
# status: ${{ job.status }}
100+
# token: ${{ secrets.GITHUB_TOKEN }}
101+
# notification_title: "{workflow} has {status_message}"
102+
# message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
103+
# footer: "Linked Repo <{repo_url}|{repo}> | <{run_url}|View Workflow run>"
104+
# notify_when: "failure"
105+
# env:
106+
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
92107

93-
- name: Generate a Diagnostic Report
94-
if: failure()
95-
run: |
96-
curl -s localhost:4566/_localstack/diagnose | gzip -cf > diagnose.json.gz
108+
# - name: Generate a Diagnostic Report
109+
# if: failure()
110+
# run: |
111+
# curl -s localhost:4566/_localstack/diagnose | gzip -cf > diagnose.json.gz
97112

98-
- name: Upload the Diagnostic Report
99-
if: failure()
100-
uses: actions/upload-artifact@v3
101-
with:
102-
name: diagnose.json.gz
103-
path: ./diagnose.json.gz
113+
# - name: Upload the Diagnostic Report
114+
# if: failure()
115+
# uses: actions/upload-artifact@v3
116+
# with:
117+
# name: diagnose.json.gz
118+
# path: ./diagnose.json.gz

0 commit comments

Comments
 (0)