Skip to content

Commit

Permalink
Refactor utils
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-richter committed Jan 9, 2020
1 parent 0e78932 commit 7f29ee8
Show file tree
Hide file tree
Showing 27 changed files with 341 additions and 387 deletions.
17 changes: 10 additions & 7 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
#
# Copyright (c) 2018-2020 Andre Richter <andre.o.richter@gmail.com>

require_relative '../utils/helpers/copyrighted'
require 'rubygems'
require 'bundler/setup'
require_relative '../utils/devtool/copyright'

source_files_exts = ['.S', '.rs', '.rb']

staged_files = `git --no-pager diff --name-only --cached`.split(/\n/)
staged_files.each do |f|
if f.include?('Makefile') || source_files_exts.include?(File.extname(f))
puts "Checking for copyright range: #{f}"
exit 1 unless copyrighted?(f)
end
staged_files = `git --no-pager diff --name-only --cached --diff-filter=d`.split(/\n/)
staged_files.select! do |f|
f.include?('Makefile') ||
f.include?('Dockerfile') ||
source_files_exts.include?(File.extname(f))
end

exit(1) unless copyright_check_files(staged_files)
8 changes: 6 additions & 2 deletions .github/workflows/build_rpi3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jobs:
rustup toolchain install nightly --component rust-src llvm-tools-preview
rustup default nightly
cargo install cargo-xbuild cargo-binutils
- name: Make all
- name: Set up Ruby
run: |
ruby utils/make_all.rb rpi3
gem install bundler
bundle install --retry 3 --with development
- name: Make
run: |
bundle exec ruby utils/devtool.rb make rpi3
8 changes: 6 additions & 2 deletions .github/workflows/build_rpi4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jobs:
rustup toolchain install nightly --component rust-src llvm-tools-preview
rustup default nightly
cargo install cargo-xbuild cargo-binutils
- name: Make all
- name: Set up Ruby
run: |
ruby utils/make_all.rb rpi4
gem install bundler
bundle install --retry 3 --with development
- name: Make
run: |
bundle exec ruby utils/devtool.rb make rpi4
41 changes: 0 additions & 41 deletions .github/workflows/check_fmt_clippy.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Various Sanity Checks

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
name: Various Sanity Checks
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v1
- name: Set up Ruby 2.x
uses: actions/setup-ruby@v1
with:
ruby-version: 2.x
- name: Set up Rust nightly
run: |
rustup self update
rustup toolchain install nightly --component rustfmt clippy rust-src
rustup default nightly
cargo install cargo-xbuild
- name: Set up Ruby
run: |
gem install bundler
bundle install --retry 3 --with development
- name: Setup misspell
run: |
curl -L -o ./install-misspell.sh https://git.io/misspell
sh ./install-misspell.sh -b ~/bin
- name: Run checks
run: |
bundle exec ruby utils/devtool.rb clippy
bundle exec ruby utils/devtool.rb copyright
bundle exec ruby utils/devtool.rb fmt_check
bundle exec ruby utils/devtool.rb misspell
bundle exec ruby utils/devtool.rb rubocop
23 changes: 0 additions & 23 deletions .github/workflows/spelling.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/test_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jobs:
rustup toolchain install nightly --component rust-src llvm-tools-preview
rustup default nightly
cargo install cargo-xbuild cargo-binutils
- name: Set up Ruby
run: |
gem install bundler
bundle install --retry 3 --with development
- name: Make all
run: |
ruby utils/test_integration_all.rb
bundle exec ruby utils/devtool.rb test_integration
7 changes: 6 additions & 1 deletion .github/workflows/test_unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ jobs:
rustup toolchain install nightly --component rust-src llvm-tools-preview
rustup default nightly
cargo install cargo-xbuild cargo-binutils
- name: Set up Ruby
run: |
gem install bundler
bundle install --retry 3 --with development
- name: Make all
run: |
ruby utils/test_unit_all.rb
bundle exec ruby utils/devtool.rb test_unit
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Gemfile.lock
xbuild_sysroot

**/target/*
**/.gdb_history

.bundle
.vendor
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Layout/IndentationWidth:
Width: 4

Metrics/LineLength:
Layout/LineLength:
Max: 100

Metrics/MethodLength:
Expand Down
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"editor.formatOnSave": true,
"editor.rulers": [
100
],
}
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

source 'https://rubygems.org'

group :development do
gem 'colorize'
gem 'rubocop', require: false
end
1 change: 1 addition & 0 deletions contributor_setup.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash

git config core.hooksPath .githooks
bundle install --path .vendor/bundle
25 changes: 0 additions & 25 deletions utils/clean_all.rb

This file was deleted.

26 changes: 0 additions & 26 deletions utils/clippy_all.rb

This file was deleted.

Loading

0 comments on commit 7f29ee8

Please sign in to comment.