Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ on:
pull_request:
push:
branches: [master]

permissions:
contents: read
pages: write
id-token: write

jobs:
test:
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} / AA ${{ matrix.activeadmin }} / SQLite
Expand Down Expand Up @@ -108,3 +114,49 @@ jobs:
with:
name: coverage
path: coverage/

- name: Generate badge.json
run: |
LAST_RUN="coverage/.last_run.json"
if [ ! -f "$LAST_RUN" ]; then
mkdir -p badge
echo '{"schemaVersion":1,"label":"coverage","message":"unknown","color":"lightgrey"}' > badge/badge.json
exit 0
fi
PERCENT=$(ruby -rjson -e "puts JSON.parse(File.read('$LAST_RUN')).dig('result','line').round(1)")
PERCENT_NUM=$(ruby -rjson -e "puts JSON.parse(File.read('$LAST_RUN')).dig('result','line')")
if ruby -e "exit(($PERCENT_NUM >= 90) ? 0 : 1)"; then COLOR="brightgreen"
elif ruby -e "exit(($PERCENT_NUM >= 75) ? 0 : 1)"; then COLOR="green"
elif ruby -e "exit(($PERCENT_NUM >= 60) ? 0 : 1)"; then COLOR="yellow"
else COLOR="red"; fi
mkdir -p badge
echo "{\"schemaVersion\":1,\"label\":\"coverage\",\"message\":\"${PERCENT}%\",\"color\":\"${COLOR}\"}" > badge/badge.json

- name: Upload badge artifact
uses: actions/upload-artifact@v4
with:
name: coverage-badge
path: badge

deploy-coverage:
needs: coverage
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download coverage badge
uses: actions/download-artifact@v4
with:
name: coverage-badge
path: .
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: .
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# ActiveAdminImport

[![Build Status ][build_badge]][build_link]
[![Coverage Status][coveralls_badge]][coveralls_link]
[![Code Climate ][codeclimate_badge]][codeclimate_link]
[![Gem Version ][rubygems_badge]][rubygems_link]
[![License ][license_badge]][license_link]
[![Build Status][build_badge]][build_link]
![Coverage][coverage_badge]
[![Code Climate][codeclimate_badge]][codeclimate_link]
[![Gem Version][rubygems_badge]][rubygems_link]
[![License][license_badge]][license_link]


The fastest and most efficient CSV import for Active Admin with support for validations, bulk inserts, and encoding handling.
Expand Down Expand Up @@ -331,8 +331,7 @@ Tool | Description

[build_badge]: https://github.com/activeadmin-plugins/active_admin_import/actions/workflows/test.yml/badge.svg
[build_link]: https://github.com/activeadmin-plugins/active_admin_import/actions
[coveralls_badge]: https://coveralls.io/repos/activeadmin-plugins/active_admin_import/badge.svg
[coveralls_link]: https://coveralls.io/github/activeadmin-plugins/active_admin_import
[coverage_badge]: https://img.shields.io/endpoint?url=https://activeadmin-plugins.github.io/active_admin_import/badge.json
[codeclimate_badge]: https://codeclimate.com/github/activeadmin-plugins/active_admin_import/badges/gpa.svg
[codeclimate_link]: https://codeclimate.com/github/activeadmin-plugins/active_admin_import
[rubygems_badge]: https://badge.fury.io/rb/active_admin_import.svg
Expand Down
Loading