Skip to content

Commit 14ff1b8

Browse files
authored
Merge pull request #2088 from carabasdaniel/cloud-ci
(maint) Add module to cloud-ci
2 parents d0b3716 + 2a40514 commit 14ff1b8

File tree

7 files changed

+278
-140
lines changed

7 files changed

+278
-140
lines changed

.github/workflows/nightly.yml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: "nightly"
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
env:
9+
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
10+
HONEYCOMB_DATASET: litmus tests
11+
12+
jobs:
13+
setup_matrix:
14+
name: "Setup Test Matrix"
15+
runs-on: ubuntu-20.04
16+
outputs:
17+
matrix: ${{ steps.get-matrix.outputs.matrix }}
18+
steps:
19+
- name: Checkout Source
20+
uses: actions/checkout@v2
21+
22+
- name: Activate Ruby 2.7
23+
uses: actions/setup-ruby@v1
24+
with:
25+
ruby-version: "2.7"
26+
27+
- name: Cache gems
28+
uses: actions/cache@v2
29+
with:
30+
path: vendor/gems
31+
key: ${{ runner.os }}-nightly-${{ hashFiles('**/Gemfile') }}
32+
restore-keys: |
33+
${{ runner.os }}-nightly-
34+
${{ runner.os }}-
35+
36+
- name: Install gems
37+
run: |
38+
bundle config path vendor/gems
39+
bundle config jobs 8
40+
bundle config retry 3
41+
bundle install
42+
bundle clean
43+
44+
- name: Setup Acceptance Test Matrix
45+
id: get-matrix
46+
run: "bundle exec matrix_from_metadata"
47+
48+
Acceptance:
49+
needs:
50+
- setup_matrix
51+
52+
runs-on: ubuntu-20.04
53+
strategy:
54+
fail-fast: false
55+
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}
56+
57+
steps:
58+
- name: Checkout Source
59+
uses: actions/checkout@v2
60+
61+
- name: Activate Ruby 2.7
62+
uses: actions/setup-ruby@v1
63+
with:
64+
ruby-version: "2.7"
65+
66+
- name: Cache gems
67+
uses: actions/cache@v2
68+
with:
69+
path: vendor/gems
70+
key: ${{ runner.os }}-nightly-${{ hashFiles('**/Gemfile') }}
71+
restore-keys: |
72+
${{ runner.os }}-nightly-
73+
${{ runner.os }}-
74+
75+
- name: Install gems
76+
run: |
77+
bundle config path vendor/gems
78+
bundle config jobs 8
79+
bundle config retry 3
80+
bundle install
81+
bundle clean
82+
83+
- name: bundler environment
84+
run: |
85+
bundle env
86+
87+
- name: Provision test environment
88+
run: |
89+
bundle exec rake 'litmus:provision[provision::provision_service,${{ matrix.platform }}]'
90+
echo ::group::=== REQUEST ===
91+
cat request.json || true
92+
echo
93+
echo ::endgroup::
94+
echo ::group::=== INVENTORY ===
95+
sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true
96+
echo ::endgroup::
97+
98+
# The provision service hands out machines as soon as they're provisioned.
99+
# The GCP VMs might still take a while to spool up and configure themselves fully.
100+
# This retry loop spins until all agents have been installed successfully.
101+
- name: Install agent
102+
uses: nick-invision/retry@v1
103+
with:
104+
timeout_minutes: 30
105+
max_attempts: 5
106+
retry_wait_seconds: 90
107+
command: bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
108+
109+
# The agent installer on windows does not finish in time for this to work. To
110+
# work around this for now, retry after a minute if installing the module failed.
111+
- name: Install module
112+
uses: nick-invision/retry@v1
113+
with:
114+
timeout_minutes: 30
115+
max_attempts: 5
116+
retry_wait_seconds: 60
117+
command: bundle exec rake 'litmus:install_module'
118+
119+
- name: Run acceptance tests
120+
run: bundle exec rake 'litmus:acceptance:parallel'
121+
122+
- name: Remove test environment
123+
if: ${{ always() }}
124+
run: |
125+
bundle exec rake 'litmus:tear_down'
126+
echo ::group::=== REQUEST ===
127+
cat request.json || true
128+
echo
129+
echo ::endgroup::
130+
131+
slack-workflow-status:
132+
if: always()
133+
name: Post Workflow Status To Slack
134+
needs:
135+
- Acceptance
136+
runs-on: ubuntu-20.04
137+
steps:
138+
- name: Slack Workflow Notification
139+
uses: Gamesight/slack-workflow-status@master
140+
with:
141+
# Required Input
142+
repo_token: ${{secrets.GITHUB_TOKEN}}
143+
slack_webhook_url: ${{secrets.SLACK_WEBHOOK}}
144+
# Optional Input
145+
channel: '#team-ia-bots'
146+
name: 'GABot'

.github/workflows/pr_test.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: "PR Testing"
2+
3+
on: [pull_request]
4+
5+
env:
6+
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
7+
HONEYCOMB_DATASET: litmus tests
8+
9+
jobs:
10+
setup_matrix:
11+
name: "Setup Test Matrix"
12+
runs-on: ubuntu-20.04
13+
outputs:
14+
matrix: ${{ steps.get-matrix.outputs.matrix }}
15+
steps:
16+
- name: Checkout Source
17+
uses: actions/checkout@v2
18+
19+
- name: Activate Ruby 2.7
20+
uses: actions/setup-ruby@v1
21+
with:
22+
ruby-version: "2.7"
23+
24+
- name: Cache gems
25+
uses: actions/cache@v2
26+
with:
27+
path: vendor/gems
28+
key: ${{ runner.os }}-pr-${{ hashFiles('**/Gemfile') }}
29+
restore-keys: |
30+
${{ runner.os }}-pr-
31+
${{ runner.os }}-
32+
33+
- name: Install gems
34+
run: |
35+
bundle config path vendor/gems
36+
bundle config jobs 8
37+
bundle config retry 3
38+
bundle install
39+
bundle clean
40+
41+
- name: Setup Acceptance Test Matrix
42+
id: get-matrix
43+
run: "bundle exec matrix_from_metadata"
44+
45+
Acceptance:
46+
needs:
47+
- setup_matrix
48+
49+
runs-on: ubuntu-20.04
50+
strategy:
51+
fail-fast: false
52+
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}
53+
54+
steps:
55+
- name: Checkout Source
56+
uses: actions/checkout@v2
57+
58+
- name: Activate Ruby 2.7
59+
uses: actions/setup-ruby@v1
60+
with:
61+
ruby-version: "2.7"
62+
63+
- name: Cache gems
64+
uses: actions/cache@v2
65+
with:
66+
path: vendor/gems
67+
key: ${{ runner.os }}-pr-${{ hashFiles('**/Gemfile') }}
68+
restore-keys: |
69+
${{ runner.os }}-pr-
70+
${{ runner.os }}-
71+
72+
- name: Install gems
73+
run: |
74+
bundle config path vendor/gems
75+
bundle config jobs 8
76+
bundle config retry 3
77+
bundle install
78+
bundle clean
79+
80+
- name: bundler environment
81+
run: |
82+
bundle env
83+
84+
- name: Provision test environment
85+
run: |
86+
bundle exec rake 'litmus:provision[provision::provision_service,${{ matrix.platform }}]'
87+
echo ::group::=== REQUEST ===
88+
cat request.json || true
89+
echo
90+
echo ::endgroup::
91+
echo ::group::=== INVENTORY ===
92+
sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true
93+
echo ::endgroup::
94+
95+
# The provision service hands out machines as soon as they're provisioned.
96+
# The GCP VMs might still take a while to spool up and configure themselves fully.
97+
# This retry loop spins until all agents have been installed successfully.
98+
- name: Install agent
99+
uses: nick-invision/retry@v1
100+
with:
101+
timeout_minutes: 30
102+
max_attempts: 5
103+
retry_wait_seconds: 90
104+
command: bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
105+
106+
# The agent installer on windows does not finish in time for this to work. To
107+
# work around this for now, retry after a minute if installing the module failed.
108+
- name: Install module
109+
uses: nick-invision/retry@v1
110+
with:
111+
timeout_minutes: 30
112+
max_attempts: 5
113+
retry_wait_seconds: 60
114+
command: bundle exec rake 'litmus:install_module'
115+
116+
- name: Run acceptance tests
117+
run: bundle exec rake 'litmus:acceptance:parallel'
118+
119+
- name: Remove test environment
120+
if: ${{ always() }}
121+
run: |
122+
bundle exec rake 'litmus:tear_down'
123+
echo ::group::=== REQUEST ===
124+
cat request.json || true
125+
echo
126+
echo ::endgroup::

.github/workflows/release.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)