Skip to content

Commit 95159a3

Browse files
committed
Updates
1 parent 2ef6277 commit 95159a3

6 files changed

Lines changed: 31 additions & 329 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -5,106 +5,17 @@ on:
55
branches:
66
- main
77
pull_request:
8-
workflow_dispatch:
9-
10-
permissions:
11-
contents: read
12-
13-
concurrency:
14-
group: ci-${{ github.workflow }}-${{ github.ref }}
15-
cancel-in-progress: true
8+
branches:
9+
- main
1610

1711
jobs:
18-
website:
19-
name: Website Sanity
12+
test:
13+
name: Test (Ruby ${{ matrix.ruby-version }})
2014
runs-on: ubuntu-latest
21-
timeout-minutes: 10
22-
23-
steps:
24-
- name: Checkout
25-
uses: actions/checkout@v5
26-
27-
- name: Set up Node.js
28-
uses: actions/setup-node@v5
29-
with:
30-
node-version: "22"
31-
32-
- name: Validate workflow YAML
33-
shell: bash
34-
run: |
35-
ruby -e 'require "yaml"; Dir[".github/workflows/*.yml"].sort.each { |file| YAML.load_file(file) }'
36-
37-
- name: Validate website asset structure
38-
shell: bash
39-
run: |
40-
test -f docs/website/index.html
41-
test -f docs/website/development.html
42-
test -f docs/website/css/core/base.css
43-
test -f docs/website/css/layout/topbar.css
44-
test -f docs/website/css/layout/sidebar.css
45-
test -f docs/website/css/layout/content.css
46-
test -f docs/website/css/layout/responsive.css
47-
test -f docs/website/css/components/workflow.css
48-
test -f docs/website/css/components/modules.css
49-
test -f docs/website/css/components/development.css
50-
test -f docs/website/js/core/site-data.js
51-
test -f docs/website/js/core/helpers.js
52-
test -f docs/website/js/features/sidebar.js
53-
test -f docs/website/js/features/easter-eggs.js
54-
test -f docs/website/js/features/search.js
55-
test -f docs/website/js/features/contact-panel.js
56-
test -f docs/website/js/features/workflow-visual.js
57-
test -f docs/website/js/features/raw-popup.js
58-
test -f docs/website/js/features/development-feed.js
59-
test -f docs/website/js/bootstrap/app.js
60-
test -f docs/website/web_assets/media/favicon.ico
61-
test -f SECURITY.md
62-
test -f docs/website/.nojekyll
63-
64-
- name: Validate website scripts
65-
shell: bash
66-
run: |
67-
for file in docs/website/js/core/*.js docs/website/js/features/*.js docs/website/js/bootstrap/*.js; do
68-
node --check "$file"
69-
done
70-
71-
- name: Validate page includes
72-
shell: bash
73-
run: |
74-
shopt -s nullglob
75-
pages=(docs/website/*.html)
76-
[ ${#pages[@]} -gt 0 ]
77-
for page in "${pages[@]}"; do
78-
grep -q 'css/core/base.css?v=' "${page}"
79-
grep -q 'css/layout/topbar.css?v=' "${page}"
80-
grep -q 'css/layout/sidebar.css?v=' "${page}"
81-
grep -q 'css/layout/content.css?v=' "${page}"
82-
grep -q 'css/components/workflow.css?v=' "${page}"
83-
grep -q 'css/components/modules.css?v=' "${page}"
84-
grep -q 'css/components/development.css?v=' "${page}"
85-
grep -q 'css/layout/responsive.css?v=' "${page}"
86-
grep -q 'js/core/site-data.js?v=' "${page}"
87-
grep -q 'js/core/helpers.js?v=' "${page}"
88-
grep -q 'js/features/sidebar.js?v=' "${page}"
89-
grep -q 'js/features/easter-eggs.js?v=' "${page}"
90-
grep -q 'js/features/search.js?v=' "${page}"
91-
grep -q 'js/features/contact-panel.js?v=' "${page}"
92-
grep -q 'js/features/workflow-visual.js?v=' "${page}"
93-
grep -q 'js/features/raw-popup.js?v=' "${page}"
94-
grep -q 'js/features/development-feed.js?v=' "${page}"
95-
grep -q 'js/bootstrap/app.js?v=' "${page}"
96-
grep -q 'topbar-contact-popover" hidden' "${page}"
97-
done
98-
99-
verify:
100-
name: Verify (Ruby ${{ matrix.ruby }})
101-
runs-on: ubuntu-latest
102-
timeout-minutes: 25
103-
needs: website
10415
strategy:
10516
fail-fast: false
10617
matrix:
107-
ruby:
18+
ruby-version:
10819
- "3.2"
10920
- "3.3"
11021

@@ -115,33 +26,10 @@ jobs:
11526
- name: Set up Ruby
11627
uses: ruby/setup-ruby@v1
11728
with:
118-
ruby-version: ${{ matrix.ruby }}
119-
bundler-cache: true
120-
121-
- name: Print runtime diagnostics
122-
run: |
123-
ruby -v
124-
bundle -v
29+
ruby-version: ${{ matrix.ruby-version }}
12530

126-
- name: Run release verification
127-
run: bundle exec rake
31+
- name: Install dependencies
32+
run: bundle install
12833

129-
- name: Dump smoke logs on failure
130-
if: failure()
131-
shell: bash
132-
run: |
133-
if [ ! -d tmp/test ]; then
134-
echo "No tmp/test directory found."
135-
exit 0
136-
fi
137-
shopt -s nullglob
138-
found=false
139-
for file in tmp/test/*.log; do
140-
found=true
141-
echo "::group::${file}"
142-
cat "${file}"
143-
echo "::endgroup::"
144-
done
145-
if [ "${found}" = false ]; then
146-
echo "No smoke log files were generated."
147-
fi
34+
- name: Run verification
35+
run: bundle exec rake verify

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ __pycache__/
55
*.pyc
66
*.gem
77
.bundle/
8+
Gemfile.lock
89
coverage/
910
.asrfacet_rb/
1011
temp/

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ source "https://rubygems.org"
1515
gemspec
1616

1717
group :development do
18+
gem "ferrum"
1819
gem "rake"
1920
gem "rspec"
2021
gem "webmock"

Gemfile.lock

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

Rakefile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,19 @@ require "rbconfig"
1616
require "rake/clean"
1717
require "rspec/core/rake_task"
1818

19-
CLEAN.include("asrfacet-rb-*.gem", "tmp/test", "install/test-root")
19+
PROJECT_ROOT = __dir__
20+
GEM_ARTIFACT_GLOB = File.join(PROJECT_ROOT, "asrfacet-rb-*.gem")
21+
22+
CLEAN.include(GEM_ARTIFACT_GLOB, "tmp/test", "install/test-root")
2023

2124
RSpec::Core::RakeTask.new(:spec) do |task|
2225
task.pattern = "spec/**/*_spec.rb"
2326
end
2427

2528
def ruby_exec(*args)
2629
ruby = RbConfig.ruby
27-
sh ruby, *args
30+
result = system(ruby, *args)
31+
raise "Command failed: #{args.join(' ')}" unless result
2832
end
2933

3034
namespace :test do
@@ -62,8 +66,10 @@ namespace :build do
6266
task :gem do
6367
gem_file = nil
6468
sh "gem", "build", "asrfacet-rb.gemspec"
65-
gem_file = Dir.glob("asrfacet-rb-*.gem").max_by { |path| File.mtime(path) }
66-
puts "[BUILD] Built #{gem_file}" if gem_file
69+
gem_file = Dir.glob(GEM_ARTIFACT_GLOB).max_by { |path| File.mtime(path) }
70+
raise "Gem build failed — no .gem artifact found" unless gem_file && File.exist?(gem_file)
71+
72+
puts "[BUILD] Built #{gem_file}"
6773
ensure
6874
FileUtils.rm_f(gem_file) if gem_file && File.exist?(gem_file)
6975
end

0 commit comments

Comments
 (0)