Skip to content

Commit

Permalink
Test gh-pages workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
uvlad7 committed Oct 10, 2023
1 parent 85f6366 commit 844322f
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 9 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Yard

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- "2.7.8"

steps:
- uses: actions/checkout@v3
# Rust is needed because I plan to setup yard-rustdoc
- name: Set up Ruby & Rust
uses: oxidize-rb/actions/setup-ruby-and-rust@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
cargo-cache: true
rubygems: "3.4.14"
- name: Build yard docs
run: YARD_OUTPUT_DIR="$RUNNER_TEMP/doc/" bundle exec yard
- name: Archive artifact
shell: sh
run: |
tar \
--dereference --hard-dereference \
--directory "$RUNNER_TEMP/doc/" \
-cvf "$RUNNER_TEMP/artifact.tar" \
.
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.name }}
path: ${{ runner.temp }}/artifact.tar
retention-days: ${{ inputs.retention-days }}
if-no-files-found: error
deploy:
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- master

pull_request:
types: [opened, reopened]

jobs:
build:
Expand Down
19 changes: 10 additions & 9 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
# frozen_string_literal: true

require "bundler/setup"
require 'bundler/setup'

require "bundler/gem_tasks"
require "rspec/core/rake_task"
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

require "rubocop/rake_task"
require 'rubocop/rake_task'

RuboCop::RakeTask.new

require "rb_sys/extensiontask"
require 'rb_sys/extensiontask'

task build: :compile

RbSys::ExtensionTask.new("xml2json") do |ext|
ext.lib_dir = "lib/xml2json"
RbSys::ExtensionTask.new('xml2json') do |ext|
ext.lib_dir = 'lib/xml2json'
end

require "yard"
require 'yard'

YARD::Rake::YardocTask.new do |t|
t.files = ["lib/**/*.rb"]
t.files = ['lib/**/*.rb']
t.options += ['--output-dir', ENV['YARD_OUTPUT_DIR']] if ENV['YARD_OUTPUT_DIR']
end

task default: %i[compile spec rubocop yard]

0 comments on commit 844322f

Please sign in to comment.