Skip to content

Commit

Permalink
Merge pull request #8098 from Fryguy/github_actions
Browse files Browse the repository at this point in the history
Switch to GitHub Actions

(cherry picked from commit b387527)
  • Loading branch information
chessbyte authored and Fryguy committed Feb 3, 2025
1 parent 214e2a4 commit 29b2a0a
Show file tree
Hide file tree
Showing 14 changed files with 106 additions and 91 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI

on: [push, pull_request]

jobs:
ci:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version:
- '2.7'
node-version:
- 12
test-suite:
- spec
- spec:compile
- spec:debride
- spec:javascript
- spec:jest
- spec:routes
include:
- ruby-version: '2.6'
node-version: 12
test-suite: spec
services:
postgres:
image: manageiq/postgresql:10
env:
POSTGRESQL_USER: root
POSTGRESQL_PASSWORD: smartvm
POSTGRESQL_DATABASE: vmdb_test
options: --health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 5
ports:
- 5432:5432
env:
TEST_SUITE: ${{ matrix.test-suite }}
PGHOST: localhost
PGPASSWORD: smartvm
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
steps:
- uses: actions/checkout@v2
- name: Set up system
run: bin/before_install
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Set up Node
if: ${{ matrix.test-suite == 'spec:compile' || matrix.test-suite == 'spec:javascript' || matrix.test-suite == 'spec:jest' }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: yarn
registry-url: https://npm.manageiq.org/
- name: Prepare tests
run: bin/setup
- name: Run tests
run: bundle exec rake
- name: Report code coverage
if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '2.7' && matrix.test-suite == 'spec' }}
continue-on-error: true
uses: paambaati/[email protected]
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package-lock.json
Gemfile.lock
Gemfile.dev.rb
_yardoc/
bin/*
coverage/
doc/
pkg/
Expand Down
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ManageIQ::UI::Classic

[![Gem Version](https://badge.fury.io/rb/manageiq-ui-classic.svg)](http://badge.fury.io/rb/manageiq-ui-classic)
[![Build Status](https://travis-ci.com/ManageIQ/manageiq-ui-classic.svg?branch=morphy)](https://travis-ci.com/ManageIQ/manageiq-ui-classic)
[![CI](https://github.com/ManageIQ/manageiq-ui-classic/actions/workflows/ci.yaml/badge.svg?branch=morphy)](https://github.com/ManageIQ/manageiq-ui-classic/actions/workflows/ci.yaml)
[![Code Climate](https://codeclimate.com/github/ManageIQ/manageiq-ui-classic.svg)](https://codeclimate.com/github/ManageIQ/manageiq-ui-classic)
[![Test Coverage](https://codeclimate.com/github/ManageIQ/manageiq-ui-classic/badges/coverage.svg)](https://codeclimate.com/github/ManageIQ/manageiq-ui-classic/coverage)
[![Coverage Status](https://coveralls.io/repos/github/ManageIQ/manageiq-ui-classic/badge.svg?branch=morphy)](https://coveralls.io/github/ManageIQ/manageiq-ui-classic?branch=morphy)
Expand Down
28 changes: 28 additions & 0 deletions bin/before_install
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

if [ -n "$CI" ]; then
echo "== Installing system packages =="
sudo apt-get install libcurl4-openssl-dev
echo
fi

if [ -n "$CI" -a \( "$TEST_SUITE" = "spec:javascript" -o "$TEST_SUITE" = "spec:jest" \) ]; then
# Install google-chrome-beta
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-beta
echo
fi

gem_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." &>/dev/null && pwd)"
spec_manageiq="$gem_root/spec/manageiq"

if [ -n "$MANAGEIQ_REPO" ]; then
echo "== Symlinking spec/manageiq to $MANAGEIQ_REPO =="
rm -rf "$spec_manageiq"
ln -s "$(cd "$MANAGEIQ_REPO" &>/dev/null && pwd)" "$spec_manageiq"
elif [ ! -d "$spec_manageiq" ]; then
echo "== Cloning manageiq sample app =="
git clone https://github.com/ManageIQ/manageiq.git --branch master --depth 1 "$spec_manageiq"
fi
16 changes: 0 additions & 16 deletions bin/ci/after_script.sh

This file was deleted.

7 changes: 0 additions & 7 deletions bin/ci/before_install.sh

This file was deleted.

7 changes: 0 additions & 7 deletions bin/ci/before_script.sh

This file was deleted.

2 changes: 1 addition & 1 deletion bin/ci/dead_method_check.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run only against PR that is based on master
if [ "$TRAVIS_PULL_REQUEST" != "false" -a "$TRAVIS_BRANCH" = "master" ]; then
if [ "$GITHUB_BASE_REF" = "master" ]; then
OLD=`mktemp`
NEW=`mktemp`

Expand Down
11 changes: 8 additions & 3 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'

require "pathname"

gem_root = Pathname.new(__dir__).join("..")
spec_manageiq = gem_root.join("spec/manageiq")
system(gem_root.join("bin/before_install").to_s)

if ENV.key?("MANAGEIQ_REPO")
manageiq_repo = Pathname.new(ENV["MANAGEIQ_REPO"])
Expand All @@ -18,3 +18,8 @@ end

require gem_root.join("spec/manageiq/lib/manageiq/environment").to_s
ManageIQ::Environment.manageiq_plugin_setup(gem_root)

if %w[spec:compile spec:javascript spec:jest].include?(ENV["TEST_SUITE"])
puts "\n== Updating UI assets =="
exit $?.exitstatus unless system("bundle exec rake update:ui")
end
1 change: 1 addition & 0 deletions bin/update
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ end
require gem_root.join("spec/manageiq/lib/manageiq/environment").to_s
ManageIQ::Environment.manageiq_plugin_update(gem_root)

puts "\n== Updating UI assets =="
ManageIQ::Environment.update_ui
4 changes: 2 additions & 2 deletions lib/tasks/manageiq/ui_tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ end
# compile and clobber when running assets:* tasks
if Rake::Task.task_defined?("assets:precompile")
Rake::Task["assets:precompile"].enhance do
Rake::Task["webpack:compile"].invoke unless ENV["TRAVIS"]
Rake::Task["webpack:compile"].invoke unless ENV["CI"]
end

Rake::Task["assets:precompile"].actions.each do |action|
Expand All @@ -103,7 +103,7 @@ end

if Rake::Task.task_defined?("assets:clobber")
Rake::Task["assets:clobber"].enhance do
Rake::Task["webpack:clobber"].invoke unless ENV["TRAVIS"]
Rake::Task["webpack:clobber"].invoke unless ENV["CI"]
end

Rake::Task["assets:clobber"].actions.each do |action|
Expand Down
2 changes: 1 addition & 1 deletion manageiq-ui-classic.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Gem::Specification.new do |s|
s.add_development_dependency "guard-rspec", '~> 4.7.3'
s.add_development_dependency "manageiq-style"
s.add_development_dependency "rails-controller-testing", '~> 1.0.2'
s.add_development_dependency "simplecov"
s.add_development_dependency "simplecov", ">= 0.21.2"

# core because jasmine gem depends on major version only, meaning breakages when not the latest
s.add_development_dependency "jasmine", "~> 3.4.0"
Expand Down
19 changes: 0 additions & 19 deletions spec/other/travis_spec.rb

This file was deleted.

0 comments on commit 29b2a0a

Please sign in to comment.