-
Notifications
You must be signed in to change notification settings - Fork 16
120 lines (98 loc) · 3.07 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
---
name: CI
on:
workflow_dispatch:
push:
branches: ["**"]
tags-ignore: ["v**"] # Skip CI for releases
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
RSPEC_FORMATTER: doc
jobs:
ci-data:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.fetch.outputs.result }}
steps:
- id: fetch
uses: oxidize-rb/actions/fetch-ci-data@v1
with:
stable-ruby-versions: |
# See https://github.com/bytecodealliance/wasmtime-rb/issues/286
# for details.
exclude: [head]
ci:
runs-on: ${{ matrix.os }}
needs: ci-data
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
ruby: ${{ fromJSON(needs.ci-data.outputs.result).stable-ruby-versions }}
# include:
# mswin relies on head and we're not creating releases for it
# so disabling it as well.
# - os: windows-latest
# ruby: mswin
steps:
- uses: actions/checkout@v4
- name: Remove Gemfile.lock
run: rm Gemfile.lock
- uses: oxidize-rb/actions/setup-ruby-and-rust@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
cargo-cache: true
cache-version: v5
- name: Compile rust ext
run: bundle exec rake compile:release
- name: Run ruby tests
run: bundle exec rake spec
- name: Run ruby tests (hard-mode with GC.stress)
run: bundle exec rake spec
env:
GC_STRESS: "true"
- name: Run examples
run: bundle exec rake examples
# The example is failing with dyld errors, it's unlikely that this is
# something related to wasmtime-rb itself. Disabling for now.
if: matrix.os != 'macos-latest' && matrix.ruby != '3.1'
- name: Run benchmarks
run: bundle exec rake bench:all
- name: Lint ruby
run: bundle exec rake standard
- name: Lint rust
run: cargo clippy -- -D warnings && cargo fmt --check
build_doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Derive nightly version
run: |
version="$(cat ./NIGHTLY_VERSION)"
echo "NIGHTLY_VERSION=$version" >> $GITHUB_ENV
- name: Remove Gemfile.lock
run: rm Gemfile.lock
- uses: oxidize-rb/actions/setup-ruby-and-rust@v1
with:
ruby-version: "3.3"
rustup-toolchain: "${{ env.NIGHTLY_VERSION }}"
bundler-cache: true
cargo-cache: true
cache-version: v1
- name: Compile rust ext
run: bundle exec rake compile
- name: Generate doc
run: bundle exec rake doc
- name: Upload generated doc
uses: actions/upload-artifact@v4
with:
name: doc
path: doc
retention-days: 1
- name: Publish doc
if: contains(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
uses: ./.github/actions/publish-doc