Skip to content

Commit e019177

Browse files
committed
Merge pull request #653 from Fryguy/better_ci
Refactor GitHub Actions ci.yml
2 parents 8f85a1f + 47f95a1 commit e019177

File tree

6 files changed

+62
-45
lines changed

6 files changed

+62
-45
lines changed

.github/workflows/actions.yml

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

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '0 0 * * 0'
8+
jobs:
9+
ci:
10+
strategy:
11+
matrix:
12+
ruby:
13+
- '3.1'
14+
- '3.2'
15+
- '3.3'
16+
- '3.4'
17+
- ruby-head
18+
- truffleruby-head
19+
gemfile:
20+
- faraday-1
21+
- faraday-2
22+
os:
23+
- macos-latest
24+
- ubuntu-latest
25+
runs-on: ${{ matrix.os }}
26+
timeout-minutes: 10
27+
env:
28+
BUNDLE_GEMFILE: test/gemfiles/Gemfile.${{ matrix.gemfile }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Set up Ruby
32+
uses: ruby/setup-ruby@v1
33+
with:
34+
ruby-version: ${{ matrix.ruby }}
35+
bundler-cache: true
36+
- name: Run tests
37+
run: bin/ci
38+
lint:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
- name: Set up Ruby
43+
uses: ruby/setup-ruby@v1
44+
with:
45+
ruby-version: '3.1' # Run rubocop against lowest supported ruby
46+
bundler-cache: true
47+
- name: Run rubocop
48+
run: bundle exec rake rubocop

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Kubeclient
22

33
[![Gem Version](https://badge.fury.io/rb/kubeclient.svg)](http://badge.fury.io/rb/kubeclient)
4-
[![Build Status](https://github.com/ManageIQ/kubeclient/actions/workflows/actions.yml/badge.svg)](https://github.com/ManageIQ/kubeclient/actions?branch=master)
4+
[![Build Status](https://github.com/ManageIQ/kubeclient/actions/workflows/ci.yml/badge.svg)](https://github.com/ManageIQ/kubeclient/actions?branch=master)
55
[![Code Climate](https://codeclimate.com/github/ManageIQ/kubeclient.svg)](https://codeclimate.com/github/ManageIQ/kubeclient)
66
[![Downloads rate by version](https://img.shields.io/badge/downloads%20rate-by%20version-blue)](https://ui.honeycomb.io/ruby-together/datasets/rubygems.org/result/7mZHKUfmHkj)
77

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require 'bundler/gem_tasks'
44
require 'rubocop/rake_task'
55
require 'yaml'
66

7-
task default: %i[test rubocop] # same as .github/workflows/actions.yml
7+
task default: %i[test rubocop]
88

99
begin
1010
fork { nil }

bin/ci

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [[ "$OSTYPE" == "darwin"* ]]; then
6+
bundle exec rake test
7+
else
8+
# Sometimes minitest starts and then just hangs printing nothing.
9+
# GitHub by default kills after 6hours(!). Hopefully SIGTERM may let it print some details?
10+
timeout --signal=TERM 3m env test/config/update_certs_k0s.rb
11+
fi

test/config/update_certs_k0s.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env ruby
22
# https://docs.k0sproject.io/latest/k0s-in-docker/
3-
# Runs in --prividged mode, only run this if you trust the k0s distribution.
3+
# Runs in --privileged mode, only run this if you trust the k0s distribution.
44

55
require 'English'
66

0 commit comments

Comments
 (0)