Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
eb4bcad
Playing with fiddle
lacostej Apr 13, 2022
d29fddc
Another way to integrate with fiddle
lacostej Apr 13, 2022
66664e7
Uniformize code
lacostej Apr 14, 2022
e556283
rubocop
lacostej Apr 14, 2022
4b24755
Let's build on multiple Windows versions
lacostej Apr 14, 2022
63e5ff1
Fix appveyor config
lacostej Apr 20, 2022
8bcaca1
Hardcode bundler version for appveyor
lacostej Apr 20, 2022
ea22bc5
Display tool versions in appveyor
lacostej Apr 20, 2022
9684922
Ignore vendor for rubocop on CI
lacostej Apr 20, 2022
3dd3e14
Configure for proper Windows image on appveyor
lacostej Apr 20, 2022
3965fc2
Configure for proper Windows image on appveyor (cleaner)
lacostej Apr 20, 2022
7fd414d
Ruby3 requires explicit rexml dependency
lacostej Apr 20, 2022
793e26c
rubocop fix, order lines
lacostej Apr 20, 2022
98bc965
Update rexml
lacostej Apr 20, 2022
79201f4
Update to ruby 3.0 and 3.1 compatible set of gems, ruby syntax and bu…
lacostej Apr 20, 2022
286030c
Drop ruby 2.4 on circle as well
lacostej Apr 20, 2022
137ec26
Fix rubocop issues detected by latest rubocop. Didn't activate ruboco…
lacostej Apr 20, 2022
02d5da0
Bump byebug etc to support ruby 3.1
lacostej Apr 20, 2022
1b3b5cb
Tentative support for matrix build on circleci as well
lacostej Apr 20, 2022
2adb7ef
Tentative support for matrix build on circleci as well
lacostej Apr 20, 2022
0468842
Disable byebug as it doesn't compile on Windows 3.1
lacostej Apr 20, 2022
1388d23
Adds test for Windows specific method using fiddle
lacostej Apr 20, 2022
e8ff396
Using correct dll for fiddle
lacostej Apr 20, 2022
6e10ca8
Avoid reusing variable
lacostej Apr 20, 2022
c893ce6
Attempt to unit test the other fiddle code
lacostej Apr 21, 2022
dbfbec5
More structured output
lacostej Apr 21, 2022
532bb27
Attempt at using a single CI provider for all platforms
lacostej Apr 21, 2022
8903179
Strengthen some tests that do not pass on all windows implementations
lacostej Apr 21, 2022
78c5d5e
Experiment further with fiddle
lacostej May 11, 2022
9e4e46f
More fixes
lacostej May 11, 2022
706e2e6
rubocop
lacostej May 11, 2022
365d1c1
Troubleshooting why there's no output...
lacostej May 11, 2022
067c501
Meh...
lacostej May 11, 2022
206dd44
rub
lacostej May 11, 2022
be719bc
Fixing first call
lacostej May 11, 2022
363e3af
rubocop...
lacostej May 11, 2022
5c3421c
Test if path is correct
lacostej May 11, 2022
50fc2fd
Fix test code
lacostej May 11, 2022
a53061c
Work around too few arguments in pack
lacostej May 11, 2022
352b767
another bug
lacostej May 11, 2022
84cd175
Play around with hack
lacostej May 11, 2022
dbbfe90
Implement hack
lacostej May 11, 2022
0d4143a
Implement proper unit test
lacostej May 11, 2022
8cad9f6
Fix test
lacostej May 11, 2022
4278891
Make test on GITHUB more robust
lacostej May 11, 2022
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
41 changes: 32 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,40 @@
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
version: 2
version: 2.1

orbs:
ruby: circleci/[email protected]

#executors:
# linux:
# docker:
# - image: cimg/base:2020.01
# macos:
# macos:
# xcode: 11.4

workflows:
all-tests:
jobs:
- build:
matrix:
parameters:
# os: [linux]
ruby-version: ["2.5", "2.6", "2.7", "3.0", "3.1"]

jobs:
build:
parameters:
# os:
# type: executor
ruby-version:
type: string

docker:
# specify the version you desire here
- image: circleci/ruby:2.4.1-node-browsers

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4
- image: cimg/ruby:<< parameters.ruby-version >>

# executor: << parameters.os >>

working_directory: ~/repo

Expand Down Expand Up @@ -61,4 +84,4 @@ jobs:
path: /tmp/rspec/
- store_artifacts:
path: /tmp/rspec/
destination: test-results
destination: test-results
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI
on: [push, pull_request]
jobs:
specs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu, macos, windows ]
ruby: [ 2.5.9, 2.6.10, 2.7.6, 3.0.4, 3.1.2 ]
runs-on: ${{ matrix.os }}-latest
steps:
- name: git config autocrlf
run: git config --global core.autocrlf false
if: matrix.os == 'windows'

- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Run specs (Linux)
if: matrix.os == 'ubuntu'
run: bundle exec rake

- name: Run specs (macOS)
if: matrix.os == 'macos'
run: bundle exec rake

- name: Run specs (Windows)
if: matrix.os == 'windows'
run: bundle exec rake
# Actions uses UTF8, causes test failures, similar to normal OS setup
#[Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
#[Console]::InputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
13 changes: 11 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
#
# File.chmod(0o777, f)
#
require:
- rubocop-rake
#- rubocop-rspec

AllCops:
NewCops: enable
#Include:
# - '**/fastlane/Fastfile'
Exclude:
- 'vendor/**/*'
- './fastlane-plugin-u3d/**/*'

# broken in 0.52.1
Expand All @@ -34,13 +40,13 @@ Metrics/ParameterLists:
Max: 8

Metrics/PerceivedComplexity:
Max: 10
Max: 12

Metrics/MethodLength:
Enabled: false

# Configuration parameters: AllowURI, URISchemes.
Metrics/LineLength:
Layout/LineLength:
Max: 370

# We're not there yet
Expand All @@ -57,4 +63,7 @@ Layout/EndOfLine:

# Some issues with rspec style
Lint/AmbiguousBlockAssociation:
Enabled: false

Lint/EmptyBlock:
Enabled: false
82 changes: 40 additions & 42 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PATH
filesize (>= 0.1.1)
inifile (>= 3.0.0, < 4.0.0)
plist (>= 3.1.0, < 4.0.0)
rexml
rubyzip (>= 1.0.0)
security (= 0.1.3)

Expand All @@ -21,10 +22,7 @@ GEM
tzinfo (~> 1.1)
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
ast (2.3.0)
builder (3.2.3)
byebug (10.0.2)
coderay (1.1.2)
ast (2.4.2)
colored (1.2)
commander (4.4.7)
highline (~> 2.0.0)
Expand All @@ -35,7 +33,7 @@ GEM
term-ansicolor (~> 1.3)
thor (~> 0.19.4)
tins (~> 1.6)
diff-lcs (1.3)
diff-lcs (1.5.0)
docile (1.1.5)
faraday (0.12.2)
multipart-post (>= 1.2, < 3)
Expand All @@ -55,51 +53,51 @@ GEM
highline (2.0.3)
i18n (0.8.6)
inifile (3.0.0)
json (2.1.0)
method_source (0.9.0)
json (2.6.1)
minitest (5.10.3)
multi_json (1.12.1)
multipart-post (2.0.0)
octokit (4.7.0)
sawyer (~> 0.8.0, >= 0.5.3)
parallel (1.12.1)
parser (2.4.0.2)
ast (~> 2.3)
parallel (1.22.1)
parser (3.1.2.0)
ast (~> 2.4.1)
plist (3.5.0)
powerpack (0.1.1)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-byebug (3.6.0)
byebug (~> 10.0)
pry (~> 0.10)
public_suffix (2.0.5)
rainbow (3.0.0)
rainbow (3.1.1)
rake (10.5.0)
regexp_parser (2.3.0)
retriable (2.1.0)
rspec (3.1.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
rexml (3.2.5)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
rspec_junit_formatter (0.2.3)
builder (< 4)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rspec_junit_formatter (0.5.1)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (0.52.1)
rubocop (1.27.0)
parallel (~> 1.10)
parser (>= 2.4.0.2, < 3.0)
powerpack (~> 0.1)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.16.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.9.0)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.17.0)
parser (>= 3.1.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
ruby-progressbar (1.11.0)
rubyzip (2.0.0)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
Expand All @@ -117,7 +115,7 @@ GEM
tins (1.15.0)
tzinfo (1.2.3)
thread_safe (~> 0.1)
unicode-display_width (1.8.0)
unicode-display_width (2.1.0)

PLATFORMS
ruby
Expand All @@ -128,12 +126,12 @@ DEPENDENCIES
bundler (~> 2.0)
coveralls
github_changelog_generator
pry-byebug
rake (~> 10.0)
rspec (~> 3.1.0)
rspec_junit_formatter (~> 0.2.3)
rubocop (~> 0.52.1)
rspec (~> 3.11.0)
rspec_junit_formatter (~> 0.5.1)
rubocop (~> 1.27)
rubocop-rake (~> 0.6.0)
u3d!

BUNDLED WITH
2.2.30
2.3.11
17 changes: 11 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

## --- BEGIN LICENSE BLOCK ---
# Copyright (c) 2016-present WeWantToKnow AS
#
Expand Down Expand Up @@ -35,7 +37,7 @@ RSpec::Core::RakeTask.new(:spec)
RuboCop::RakeTask.new

class GithubChangelogGenerator
PATH = '.github_changelog_generator'.freeze
PATH = '.github_changelog_generator'
class << self
def future_release
s = File.read(PATH)
Expand All @@ -56,13 +58,13 @@ class GithubChangelogGenerator
line
end
end
File.write(PATH, lines.join("\n") + "\n")
File.write(PATH, "#{lines.join("\n")}\n")
end
end
end

class U3dCode
PATH = 'lib/u3d/version.rb'.freeze
PATH = 'lib/u3d/version.rb'
class << self
def version=(version)
s = File.read(PATH)
Expand All @@ -74,7 +76,7 @@ class U3dCode
line
end
end
File.write(PATH, lines.join("\n") + "\n")
File.write(PATH, "#{lines.join("\n")}\n")
end
end
end
Expand Down Expand Up @@ -126,17 +128,19 @@ def github_reviewers
end
###

desc 'Ensure the git repository is clean. Fails otherwise'
task :ensure_git_clean do
branch = run_command('git rev-parse --abbrev-ref HEAD', "Couldn't get current git branch").strip
UI.user_error!("You are not on 'master' but on '#{branch}'") unless branch == "master"
output = run_command('git status --porcelain', "Couldn't get git status")
UI.user_error!("git status not clean:\n#{output}") unless output == ""
end

# ensure ready to prepare a PR
desc 'Ensure we are ready to prepare a PR'
task :prepare_git_pr, [:pr_branch] do |_t, args|
pr_branch = args['pr_branch']
raise "Missing pr_branch argument" unless pr_branch

UI.user_error! "Prepare git PR stopped by user" unless UI.confirm("Creating PR branch #{pr_branch}")
run_command("git checkout -b #{pr_branch}")
end
Expand Down Expand Up @@ -216,9 +220,10 @@ def parse_changelog
if (m = line.match(/^## \[(.*)\]/))
releases[version] = buffer if buffer
version = m[1]
buffer = version + "\n\n"
buffer = "#{version}\n\n"
else
next unless version # skip first lines

buffer += line
end
end
Expand Down
31 changes: 25 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
# https://www.appveyor.com/docs/appveyor-yml/

image: Visual Studio 2022

version: "{build}"

init:
- git config --global core.autocrlf false

# cloning the repository happens here

install:
- set PATH=C:\Ruby24-x64\bin;%PATH%
- bundle install
cache:
- vendor/bundle

environment:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
matrix:
- RUBY_VERSION: 25
- RUBY_VERSION: 26
- RUBY_VERSION: 27
- RUBY_VERSION: 30
- RUBY_VERSION: 31

install:
- set PATH=C:\Ruby%RUBY_VERSION%-x64\bin;%PATH%
- set BUNDLER_VERSION=2.3.11
- ruby -v
- gem -v
- bundle -v
- gem install bundler -v %BUNDLER_VERSION%
- bundle config --local path vendor/bundle
- bundle install

build: off

before_test:
- ruby -v
- gem -v
- bundle -v

test_script:
- bundle exec rake
Loading