Skip to content

Commit d6d2268

Browse files
♻️ harmonize GH CI (#141)
1 parent 95593f5 commit d6d2268

File tree

11 files changed

+100
-27
lines changed

11 files changed

+100
-27
lines changed

.github/workflows/publish.yml renamed to .github/workflows/_publish-code.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Publish
22

33
on:
4-
release:
5-
types: [ published ]
4+
workflow_call:
5+
workflow_dispatch:
66

77
jobs:
88
linting:

.github/workflows/docs.yml renamed to .github/workflows/_publish-docs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
#
2+
# Publish Documentation to GitHub pages.
3+
#
14
name: Publish Documentation
25

36
on:
4-
release:
5-
types: [ published ]
6-
7-
# Allows running this workflow manually from the Actions tab
7+
workflow_call:
88
workflow_dispatch:
99

1010
jobs:
@@ -25,7 +25,7 @@ jobs:
2525
bundle exec rake doc
2626
2727
- name: Deploy
28-
uses: peaceiris/actions-gh-pages@v3
28+
uses: peaceiris/actions-gh-pages@v4
2929
with:
3030
github_token: ${{ secrets.GITHUB_TOKEN }}
3131
publish_dir: ./docs/_build

.github/workflows/sync-readme.yml renamed to .github/workflows/_publish-guide.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
name: Sync `documentation` directory to ReadMe
1+
name: Publish Guide to readme.com
22

3-
# Run workflow for every push to the `main` branch
43
on:
4+
workflow_call:
55
workflow_dispatch:
6-
release:
7-
branches:
8-
- main
96

107
jobs:
118
sync:

.github/workflows/linting.yml renamed to .github/workflows/_static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Static Analysis
55

66
on:
7-
- push
7+
workflow_call:
88

99
jobs:
1010
linting:

.github/workflows/test-code-samples.yml renamed to .github/workflows/_test-code-samples.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
name: Test Code Samples
22

33
on:
4-
pull_request:
5-
schedule:
6-
- cron: '0 0 * * *'
7-
8-
# Allow running this workflow manually from the Actions tab
4+
workflow_call:
95
workflow_dispatch:
106

117
jobs:

.github/workflows/integration-test.yml renamed to .github/workflows/_test-integrations.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
#
2-
# Run Integration tests.
2+
# Run integration tests.
33
#
44
name: Integration Tests
55

66
on:
7-
- push
7+
workflow_call:
88

99
jobs:
10-
tests:
11-
name: Test ${{ matrix.os }}, Ruby ${{ matrix.ruby }}
10+
integration-tests:
11+
name: Run Integration Tests
12+
timeout-minutes: 30
1213
runs-on: ${{ matrix.os }}
1314
strategy:
15+
max-parallel: 3
1416
matrix:
1517
os:
16-
- "ubuntu-22.04"
18+
- "ubuntu-24.04"
19+
- "macos-latest"
1720
ruby:
1821
- "2.6"
1922
- "2.7"
2023
- "3.0"
2124
- "3.1"
2225
- "3.2"
26+
- "3.3"
2327
steps:
2428
- uses: actions/checkout@v4
2529
with:
@@ -54,3 +58,13 @@ jobs:
5458
WORKFLOW_ID: ${{ secrets.WORKFLOW_ID_SE_TESTS }}
5559
run: |
5660
bundle exec rake integration
61+
62+
- name: Notify Slack Action on Failure
63+
uses: ravsamhq/notify-slack-action@2.3.0
64+
if: ${{ always() && github.ref_name == 'main' }}
65+
with:
66+
status: ${{ job.status }}
67+
notify_when: "failure"
68+
notification_title: "[Ruby] Integration test '{workflow}' is failing"
69+
env:
70+
SLACK_WEBHOOK_URL: ${{ secrets.PRODUCTION_ISSUES_SLACK_HOOK_URL }}

.github/workflows/test.yml renamed to .github/workflows/_test-units.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,26 @@
44
name: Tests
55

66
on:
7-
- push
7+
workflow_call:
88

99
jobs:
1010
tests:
11-
name: Test ${{ matrix.os }}, Ruby ${{ matrix.ruby }}
11+
name: Run Unit Tests
12+
timeout-minutes: 30
1213
runs-on: ${{ matrix.os }}
1314
strategy:
1415
matrix:
1516
os:
17+
- "ubuntu-24.04"
1618
- "ubuntu-22.04"
17-
- "ubuntu-20.04"
1819
- "macos-latest"
1920
ruby:
2021
- "2.6"
2122
- "2.7"
2223
- "3.0"
2324
- "3.1"
2425
- "3.2"
26+
- "3.3"
2527
steps:
2628
- uses: actions/checkout@v4
2729
with:
@@ -37,7 +39,7 @@ jobs:
3739
if: runner.os == 'Linux'
3840
run: |
3941
sudo apt update
40-
sudo apt-get install -y ghostscript
42+
sudo apt-get install -y ghostscript imagemagick
4143
4244
- name: Install Ghostscript and ImageMagick on macOS
4345
if: runner.os == 'macOS'

.github/workflows/cron.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Crontab
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
7+
jobs:
8+
test_code_samples:
9+
uses: mindee/mindee-api-ruby/.github/workflows/_test-code-samples.yml@main
10+
secrets: inherit
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Publish Release
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
7+
jobs:
8+
publish_docs:
9+
uses: mindee/mindee-api-ruby/.github/workflows/_publish-docs.yml@main
10+
secrets: inherit
11+
publish_guide:
12+
uses: mindee/mindee-api-ruby/.github/workflows/_publish-guide.yml@main
13+
needs: publish_docs
14+
secrets: inherit
15+
publish_code:
16+
uses: mindee/mindee-api-ruby/.github/workflows/_publish-code.yml@main
17+
secrets: inherit

.github/workflows/pull-request.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Pull Request
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
static_analysis:
8+
uses: mindee/mindee-api-ruby/.github/workflows/_static-analysis.yml@main
9+
test_units:
10+
uses: mindee/mindee-api-ruby/.github/workflows/_test-units.yml@main
11+
needs: static_analysis
12+
secrets: inherit
13+
test_integrations:
14+
uses: mindee/mindee-api-ruby/.github/workflows/_test-integrations.yml@main
15+
needs: test_units
16+
secrets: inherit
17+
test_code_samples:
18+
uses: mindee/mindee-api-ruby/.github/workflows/_test-code-samples.yml@main
19+
needs: test_units
20+
secrets: inherit

0 commit comments

Comments
 (0)