-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (51 loc) · 1.39 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
ci-data:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.fetch.outputs.result }}
steps:
- id: fetch
uses: oxidize-rb/actions/fetch-ci-data@main
with:
stable-ruby-versions: |
exclude: []
ci:
runs-on: ${{ matrix.os }}
needs: ci-data
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
ruby: ${{ fromJSON(needs.ci-data.outputs.result).stable-ruby-versions }}
include:
- os: windows-latest
ruby: mswin
steps:
- uses: actions/checkout@v3
- uses: oxidize-rb/actions/setup-ruby-and-rust@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
cargo-cache: true
cache-version: v2
- name: Run ruby tests
run: bundle exec rake compile && bundle exec ruby -rminitest/autorun -Itest test/oxi/test_test.rb
- name: Lint rust
run: cargo clippy && cargo fmt --check
- name: Test source gem
shell: bash
run: |
bundle exec rake build
gem install --verbose pkg/*.gem
if ruby -roxi/test -e "puts Oxi::Test.hello('world!')" | grep "Hello, world!"; then
echo "Success"
else
echo "Failure"
exit 1
fi