grape-swagger-rails 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffcf0643d9b054671fd47900f9f02945c79d714fb03fa2f80031797690e2727e
4
- data.tar.gz: 184ba65717b81357770ed99ba76e226e8df2c6ac9df68a31aeef4369589c59e7
3
+ metadata.gz: 2b270749bdb6de1a32b2dcedf17889b7c86568c191c455f8ac435f181f2a4079
4
+ data.tar.gz: 4f8a76c95938fd5e629b700007643a56cf9a3005f0ad75cad9a9863e0ce58aa6
5
5
  SHA512:
6
- metadata.gz: e265e51c6eaed1ce5c8dfc3b79b1cbe2edafa75176af8434470867584b6b3ecc154e685b227f72a3cfb1e52fd60fea6e13996c05c337228cf6681446eba5a059
7
- data.tar.gz: e34c23d74700a8ea688371ec9de88787489d4178cbc8a96eb4d1b843cbd96ad0f0e05d20d1b22e6a8c47915b75b0689c9e4101455ecd521cfe6176e366330162
6
+ metadata.gz: 8c70abb532e972a622be3f653d3f0ff8c3bb7417fcee046348a2ef7fa56758ccd697b464be920e607f301c1832803661574efb2005a1339f209835fb2f3691f1
7
+ data.tar.gz: 4c946f35334ed771a3019dcf9aa696345158fc2e65a6490556c8eb40c93adc94c4d937691ac905f20e0bbf6941c056f4d0a05cac97566cca0911dc76278c27c5
@@ -3,7 +3,13 @@ on:
3
3
  workflow_run:
4
4
  workflows: ['Danger']
5
5
  types: [completed]
6
+
7
+ permissions:
8
+ actions: read
9
+ issues: write
10
+ pull-requests: write
11
+
6
12
  jobs:
7
13
  comment:
8
- uses: numbata/danger-pr-comment/.github/workflows/danger-comment.yml@v0.1.0
9
- secrets: inherit
14
+ if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion != 'cancelled'
15
+ uses: numbata/danger-pr-comment/.github/workflows/danger-comment.yml@v0.2.0
@@ -4,21 +4,25 @@ on:
4
4
  types: [opened, reopened, synchronize, edited]
5
5
 
6
6
  permissions:
7
- contents: write
7
+ contents: read
8
8
  pull-requests: read
9
9
 
10
10
  jobs:
11
11
  changelog:
12
+ name: Update Changelog
12
13
  # A pull_request token cannot write to a branch in somebody else's fork.
13
14
  if: github.event.pull_request.head.repo.full_name == github.repository
14
15
  runs-on: ubuntu-latest
16
+ permissions:
17
+ contents: write
15
18
  steps:
16
- - uses: actions/checkout@v4
19
+ - name: Check Out PR Branch
20
+ uses: actions/checkout@v7
17
21
  with:
18
22
  ref: ${{ github.event.pull_request.head.ref }}
19
23
  repository: ${{ github.event.pull_request.head.repo.full_name }}
20
24
  token: ${{ secrets.GITHUB_TOKEN }}
21
- - name: Add the pull request to the next release
25
+ - name: Add Pull Request To Next Release
22
26
  env:
23
27
  PR_AUTHOR: ${{ github.event.pull_request.user.login }}
24
28
  PR_AUTHOR_URL: ${{ github.event.pull_request.user.html_url }}
@@ -26,7 +30,7 @@ jobs:
26
30
  PR_TITLE: ${{ github.event.pull_request.title }}
27
31
  PR_URL: ${{ github.event.pull_request.html_url }}
28
32
  run: ruby script/update_changelog
29
- - name: Commit the changelog
33
+ - name: Commit Changelog
30
34
  env:
31
35
  PR_NUMBER: ${{ github.event.pull_request.number }}
32
36
  run: |
@@ -42,8 +46,7 @@ jobs:
42
46
  danger:
43
47
  needs: changelog
44
48
  if: always() && (needs.changelog.result == 'success' || needs.changelog.result == 'skipped')
45
- uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.1.0
49
+ uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.2.0
46
50
  with:
47
- ruby-version: '3.4'
51
+ ruby-version: '4.0'
48
52
  bundler-cache: true
49
- secrets: inherit
@@ -0,0 +1,79 @@
1
+ name: Lint
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15
+
16
+ jobs:
17
+ ruby:
18
+ name: Ruby
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 10
21
+ steps:
22
+ - name: Check Out Code
23
+ uses: actions/checkout@v7
24
+ with:
25
+ persist-credentials: false
26
+ - name: Set Up Ruby
27
+ uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: '4.0'
30
+ bundler-cache: true
31
+ - name: Lint Ruby
32
+ run: bundle exec rake rubocop
33
+
34
+ frontend:
35
+ name: Frontend
36
+ runs-on: ubuntu-latest
37
+ timeout-minutes: 10
38
+ steps:
39
+ - name: Check Out Code
40
+ uses: actions/checkout@v7
41
+ with:
42
+ persist-credentials: false
43
+ - name: Set Up Node.js
44
+ uses: actions/setup-node@v7
45
+ with:
46
+ node-version: '26'
47
+ - name: Set Up Corepack
48
+ run: |
49
+ npm install --global corepack@0.36.0
50
+ corepack enable
51
+ - name: Cache Yarn Dependencies
52
+ uses: actions/cache@v6
53
+ with:
54
+ path: .yarn/cache
55
+ key: yarn-${{ runner.os }}-node26-${{ hashFiles('yarn.lock') }}
56
+ - name: Install Dependencies
57
+ run: yarn install --immutable
58
+ - name: Check Types
59
+ run: yarn typecheck
60
+ - name: Build Frontend
61
+ run: yarn build:frontend
62
+ - name: Check Committed Frontend Assets
63
+ run: |
64
+ git diff --exit-code -- \
65
+ app/assets/javascripts/grape_swagger_rails/index.js \
66
+ app/assets/javascripts/grape_swagger_rails/index.min.js \
67
+ app/assets/javascripts/grape_swagger_rails/index.min.js.map
68
+
69
+ workflows:
70
+ name: GitHub Actions
71
+ runs-on: ubuntu-latest
72
+ timeout-minutes: 5
73
+ steps:
74
+ - name: Check Out Code
75
+ uses: actions/checkout@v7
76
+ with:
77
+ persist-credentials: false
78
+ - name: Lint Workflows
79
+ uses: docker://rhysd/actionlint:1.7.12
@@ -11,17 +11,19 @@ permissions:
11
11
 
12
12
  jobs:
13
13
  update:
14
+ name: Update Swagger UI
14
15
  runs-on: ubuntu-latest
15
16
  steps:
16
- - uses: actions/checkout@v6
17
+ - name: Check Out Code
18
+ uses: actions/checkout@v7
17
19
 
18
- - name: Set up Ruby
20
+ - name: Set Up Ruby
19
21
  uses: ruby/setup-ruby@v1
20
22
  with:
21
- ruby-version: "3.4"
23
+ ruby-version: '4.0'
22
24
  bundler-cache: true
23
25
 
24
- - name: Check latest Swagger UI release
26
+ - name: Check Latest Swagger UI Release
25
27
  id: swagger-ui
26
28
  env:
27
29
  GH_TOKEN: ${{ github.token }}
@@ -30,23 +32,24 @@ jobs:
30
32
  latest_tag="$(gh api repos/swagger-api/swagger-ui/releases/latest --jq .tag_name)"
31
33
  latest_version="${latest_tag#v}"
32
34
 
33
- echo "current-version=${current_version}" >> "$GITHUB_OUTPUT"
34
- echo "latest-tag=${latest_tag}" >> "$GITHUB_OUTPUT"
35
- echo "latest-version=${latest_version}" >> "$GITHUB_OUTPUT"
35
+ {
36
+ echo "current-version=${current_version}"
37
+ echo "latest-tag=${latest_tag}"
38
+ echo "latest-version=${latest_version}"
39
+ if [ "$current_version" != "$latest_version" ]; then
40
+ echo "update-needed=true"
41
+ else
42
+ echo "update-needed=false"
43
+ fi
44
+ } >> "$GITHUB_OUTPUT"
36
45
 
37
- if [ "$current_version" != "$latest_version" ]; then
38
- echo "update-needed=true" >> "$GITHUB_OUTPUT"
39
- else
40
- echo "update-needed=false" >> "$GITHUB_OUTPUT"
41
- fi
42
-
43
- - name: Update Swagger UI assets
46
+ - name: Update Swagger UI Assets
44
47
  if: steps.swagger-ui.outputs.update-needed == 'true'
45
48
  env:
46
49
  SWAGGER_UI_VERSION: ${{ steps.swagger-ui.outputs.latest-tag }}
47
50
  run: bundle exec rake swagger_ui:dist:update
48
51
 
49
- - name: Collect Swagger UI release notes
52
+ - name: Collect Swagger UI Release Notes
50
53
  if: steps.swagger-ui.outputs.update-needed == 'true'
51
54
  env:
52
55
  GH_TOKEN: ${{ github.token }}
@@ -54,10 +57,10 @@ jobs:
54
57
  TO_VERSION: ${{ steps.swagger-ui.outputs.latest-version }}
55
58
  run: ruby script/swagger_ui_release_notes > "${RUNNER_TEMP}/pull-request-body.md"
56
59
 
57
- - name: Create pull request
60
+ - name: Create Pull Request
58
61
  id: pull-request
59
62
  if: steps.swagger-ui.outputs.update-needed == 'true'
60
- uses: peter-evans/create-pull-request@v7
63
+ uses: peter-evans/create-pull-request@v8
61
64
  with:
62
65
  token: ${{ github.token }}
63
66
  branch: update-swagger-ui-${{ steps.swagger-ui.outputs.latest-version }}
@@ -67,7 +70,7 @@ jobs:
67
70
  body-path: ${{ runner.temp }}/pull-request-body.md
68
71
 
69
72
  # PRs created with GITHUB_TOKEN do not trigger the Danger PR workflow.
70
- - name: Add the pull request to the changelog
73
+ - name: Add Pull Request To Changelog
71
74
  if: steps.pull-request.outputs.pull-request-number != ''
72
75
  env:
73
76
  GH_TOKEN: ${{ github.token }}
@@ -1,48 +1,58 @@
1
- name: Tests
1
+ name: Test
2
2
  on:
3
3
  push:
4
4
  branches:
5
5
  - master
6
6
  pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ concurrency:
12
+ group: ${{ github.workflow }}-${{ github.ref }}
13
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
14
+
7
15
  jobs:
8
16
  test:
9
- runs-on: ubuntu-latest
17
+ name: Ruby ${{ matrix.entry.ruby }} / JSON ${{ matrix.entry.json }} / ${{ matrix.entry.os }}
18
+ runs-on: ${{ matrix.entry.os }}
19
+ timeout-minutes: 20
10
20
  strategy:
11
21
  fail-fast: false
12
22
  matrix:
13
- ruby: ['3.2', '3.3', '3.4']
14
- rails: ['~> 8.1.4']
15
- json: ['~> 2.0', '~> 3.0']
23
+ entry:
24
+ - { os: ubuntu-latest, ruby: '3.2', json: '~> 2.0' }
25
+ - { os: ubuntu-latest, ruby: '3.3', json: '~> 3.0' }
26
+ - { os: ubuntu-latest, ruby: '3.4', json: '~> 2.0' }
27
+ - { os: ubuntu-latest, ruby: '4.0', json: '~> 3.0' }
28
+ - { os: macos-latest, ruby: '4.0', json: '~> 3.0' }
16
29
  env:
17
30
  GRAPE_VERSION: '~> 3.1.0'
18
31
  GRAPE_SWAGGER_VERSION: '2.1.4'
19
- RAILS_VERSION: ${{ matrix.rails }}
20
- JSON_VERSION: ${{ matrix.json }}
32
+ RAILS_VERSION: '~> 8.1.4'
33
+ JSON_VERSION: ${{ matrix.entry.json }}
34
+ HEADLESS: 'true'
35
+ SE_SKIP_DRIVER_IN_PATH: 'true'
21
36
  steps:
22
- - uses: actions/checkout@v6
23
- - name: Set up Ruby
37
+ - name: Check Out Code
38
+ uses: actions/checkout@v7
39
+ with:
40
+ persist-credentials: false
41
+ - name: Set Up Ruby
24
42
  uses: ruby/setup-ruby@v1
25
43
  with:
26
- ruby-version: ${{ matrix.ruby }}
44
+ ruby-version: ${{ matrix.entry.ruby }}
27
45
  bundler-cache: true
28
- - name: Print Bundler Versions
29
- run: bundle show
30
- - name: Setup Firefox
31
- uses: browser-actions/setup-firefox@v1
32
- with:
33
- firefox-version: "130.0"
34
- - uses: browser-actions/setup-geckodriver@latest
46
+ - name: Set Up Firefox
47
+ uses: browser-actions/setup-firefox@v1.7.2
35
48
  with:
36
- geckodriver-version: "0.35.0"
37
- - name: Run tests with Sprockets
38
- uses: coactions/setup-xvfb@v1
49
+ firefox-version: latest
50
+ - name: Test With Sprockets
39
51
  env:
40
52
  ASSET_PIPELINE: sprockets
41
- with:
42
- run: bundle exec rake spec
43
- - name: Run tests with Propshaft
44
- uses: coactions/setup-xvfb@v1
53
+ run: bundle exec rake spec
54
+ - name: Test With Propshaft
55
+ if: ${{ !cancelled() }}
45
56
  env:
46
57
  ASSET_PIPELINE: propshaft
47
- with:
48
- run: bundle exec rake spec
58
+ run: bundle exec rake spec