Skip to content

Commit 2897271

Browse files
committed
Move to GitHub Actions (#26)
1 parent c3f5752 commit 2897271

File tree

7 files changed

+53
-15
lines changed

7 files changed

+53
-15
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 1 * *'
8+
9+
jobs:
10+
linux:
11+
runs-on: ubuntu-latest
12+
container: crystallang/crystal:latest-alpine
13+
steps:
14+
- name: Download source code
15+
uses: actions/checkout@v4
16+
- name: Format
17+
run: "crystal tool format --check"
18+
- name: Run tests
19+
run: "crystal spec --warnings none"

.github/workflows/documentation.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
container:
12+
image: crystallang/crystal:latest-alpine
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Build
16+
run: crystal docs -o /docs
17+
- name: Deploy
18+
run: |
19+
git config user.name CI
20+
git config user.email ""
21+
git checkout -f --orphan gh-pages
22+
git rm --cached -rfq .
23+
git clean -fxdq
24+
mv /docs/* .
25+
git add .
26+
git commit -qm "Update docs"
27+
git push -f --set-upstream origin gh-pages

.travis.yml

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

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ISC License
22

3-
Copyright (c) 2017-2018 Bar Hofesh, Julien Reichardt and Crystal Community contributors
3+
Copyright (c) Bar Hofesh, Julien Reichardt and Crystal Community contributors
44

55
Permission to use, copy, modify, and distribute this software for any
66
purpose with or without fee is hereby granted, provided that the above

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# hardware
22

3-
[![GitHub release](https://img.shields.io/github/release/crystal-community/hardware.svg)](https://github.com/crystal-community/hardware/releases)
4-
[![Build Status](https://travis-ci.org/crystal-community/hardware.svg?branch=master)](https://travis-ci.org/crystal-community/hardware)
3+
[![CI](https://github.com/crystal-community/hardware/workflows/CI/badge.svg)](https://github.com/crystal-community/hardware/actions?query=workflow%3ACI)
4+
[![Documentation](https://github.com/crystal-community/hardware/workflows/Documentation/badge.svg)](https://crystal-community.github.io/hardware)
5+
[![ISC](https://img.shields.io/badge/License-ISC-blue.svg?style=flat-square)](https://en.wikipedia.org/wiki/ISC_license)
56

67
A basic module to get CPU, memory and network informations of the current running OS and its processes.
78

@@ -65,4 +66,4 @@ $ docker-compose run spec
6566
## Contributors
6667

6768
- [bararchy](https://github.com/bararchy) - creator, maintainer
68-
- [j8r](https://github.com/j8r) - contributor
69+
- [j8r](https://github.com/j8r) - maintainer

shard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: hardware
2-
version: 0.5.2
2+
version: 0.5.3
33

44
authors:
55
- bararchy <[email protected]>
6-
- Julien Reichardt <mi@jrei.ch>
6+
- Julien Reichardt <git@jrei.ch>
77

88
crystal: ">= 0.35, < 2"
99

spec/pid/stat_spec.cr

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ describe Hardware::PID::Stat do
2222
stat = pid.stat
2323
sleep 4.seconds
2424
channel.send stat.cpu_usage!
25-
rescue ex : Hardware::Error
26-
channel.send 0
2725
end
2826
pids_count += 1
2927
end
@@ -32,9 +30,6 @@ describe Hardware::PID::Stat do
3230
cpu_usage = channel.receive
3331
cpu_usage.should be >= 0
3432
cpu_usage.should be <= 100
35-
max_cpu_usage = cpu_usage if max_cpu_usage < cpu_usage
3633
end
37-
# At least one process in the system should have a cpu_usage superior to 0
38-
max_cpu_usage.should be > 0
3934
end
4035
end

0 commit comments

Comments
 (0)