Skip to content

Commit 868967a

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

File tree

1 file changed

+86
-69
lines changed

1 file changed

+86
-69
lines changed

.github/workflows/integration-test.yml

Lines changed: 86 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -17,87 +17,104 @@ 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+
env:
34+
INPUTS: ${{ toJson(inputs) }}
35+
steps:
36+
- name: Get selected runner OS
37+
id: get-selected-os
38+
run: >
39+
os-runners=$(jq -cr "map_values(. // empty) | keys" <<< "$INPUTS") >> $GITHUB_OUTPUT
40+
2941
run-it-tests-job:
30-
runs-on: ${{ inputs.runner-os || 'ubuntu-latest' }}
42+
needs: get-selected-os
43+
strategy:
44+
matrix:
45+
os: ${{ fromJSON(needs.get-selected-os.outputs.os-runners) }}
46+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
3147
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v2
48+
- run: echo '${{ needs.get-selected-os.outputs.os-runners }}'
49+
# - name: Checkout
50+
# uses: actions/checkout@v2
3451

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

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
58+
# - name: Docker setup (macos only)
59+
# id: setup-docker-mac
60+
# if: ${{ runner.os == 'macOS' }}
61+
# run: |
62+
# brew install docker
63+
# colima start
4764

48-
- name: Set up Project
49-
run: |
50-
pip install -r requirements-dev.txt
65+
# - name: Set up Project
66+
# run: |
67+
# pip install -r requirements-dev.txt
5168

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 }}
69+
# - name: Start LocalStack
70+
# uses: LocalStack/setup-localstack@v0.2.0
71+
# with:
72+
# image-tag: 'latest'
73+
# use-pro: 'true'
74+
# configuration: LS_LOG=trace
75+
# install-awslocal: 'true'
76+
# env:
77+
# LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
6178

62-
- name: Deploy infrastructure
63-
run: |
64-
bin/deploy.sh
79+
# - name: Deploy infrastructure
80+
# run: |
81+
# bin/deploy.sh
6582

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
83+
# - name: Run Tests
84+
# env:
85+
# AWS_DEFAULT_REGION: us-east-1
86+
# AWS_REGION: us-east-1
87+
# AWS_ACCESS_KEY_ID: test
88+
# AWS_SECRET_ACCESS_KEY: test
89+
# run: |
90+
# pytest tests
7491

75-
- name: Show localstack logs
76-
if: always()
77-
run: |
78-
localstack logs
92+
# - name: Show localstack logs
93+
# if: always()
94+
# run: |
95+
# localstack logs
7996

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 }}
97+
# - name: Send a Slack notification
98+
# if: failure() || github.event_name != 'pull_request'
99+
# uses: ravsamhq/notify-slack-action@v2
100+
# with:
101+
# status: ${{ job.status }}
102+
# token: ${{ secrets.GITHUB_TOKEN }}
103+
# notification_title: "{workflow} has {status_message}"
104+
# message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
105+
# footer: "Linked Repo <{repo_url}|{repo}> | <{run_url}|View Workflow run>"
106+
# notify_when: "failure"
107+
# env:
108+
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
92109

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

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
115+
# - name: Upload the Diagnostic Report
116+
# if: failure()
117+
# uses: actions/upload-artifact@v3
118+
# with:
119+
# name: diagnose.json.gz
120+
# path: ./diagnose.json.gz

0 commit comments

Comments
 (0)