Repository navigation
115 lines (100 loc) · 3.52 KB
/
Copy pathci.yml
File metadata and controls
115 lines (100 loc) · 3.52 KB
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
name: LOAMP CI
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-24.04
timeout-minutes: 20
env:
GSK_RENDERER: cairo
LIBGL_ALWAYS_SOFTWARE: '1'
LOAMP_SCREENSHOT_DIR: tmp/e2e-screenshots
TAGLIB_DIR: /usr/local
steps:
- uses: actions/checkout@v7
# Native libraries must exist before setup-ruby installs the cached bundle.
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-4-dev libadwaita-1-dev gir1.2-adw-1 libgirepository1.0-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly gstreamer1.0-tools \
build-essential pkg-config cmake libutfcpp-dev zlib1g-dev curl dbus xvfb
# taglib-ruby 2.x needs TagLib >= 2.0.1; Ubuntu 24.04 ships TagLib 1.13.
- name: Build TagLib 2.0.2
working-directory: ${{ runner.temp }}
run: |
curl --fail --location --retry 3 \
https://github.com/taglib/taglib/releases/download/v2.0.2/taglib-2.0.2.tar.gz \
--output taglib-2.0.2.tar.gz
tar -xzf taglib-2.0.2.tar.gz
cmake -S taglib-2.0.2 -B taglib-build \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$TAGLIB_DIR" \
-DCMAKE_INSTALL_LIBDIR=lib -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF
cmake --build taglib-build --parallel 2
sudo cmake --install taglib-build
sudo ldconfig
pkg-config --atleast-version=2.0.1 taglib
pkg-config --modversion taglib gobject-introspection-1.0
- uses: ruby/setup-ruby@v1
with:
ruby-version: '4.0'
bundler-cache: true
cache-version: taglib-2.0.2
- name: RuboCop
run: bundle exec rubocop
- name: Tests and coverage
shell: bash
run: |
mkdir -p tmp
test_status=0
xvfb-run -a dbus-run-session -- bundle exec rspec > tmp/rspec.log 2>&1 || test_status=$?
cat tmp/rspec.log
exit "$test_status"
env:
COVERAGE: 'true'
- name: Report test failure
if: failure()
run: |
ruby <<'RUBY'
if File.file?('tmp/rspec.log')
message = File.readlines('tmp/rspec.log').last(100).join
message = message.gsub('%', '%25').gsub("\r", '%0D').gsub("\n", '%0A')
puts "::error title=RSpec failure::#{message}"
end
RUBY
- name: Integration tests
run: xvfb-run -a dbus-run-session -- bundle exec ruby spec/integration_test.rb
- name: Build archive
run: bundle exec rake build
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: loamp-source
path: pkg/*.tar.gz
if-no-files-found: error
- name: Upload test reports and screenshots
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports-ruby-4.0
path: |
coverage/
tmp/e2e-screenshots/
tmp/rspec.log
if-no-files-found: ignore
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
files: ./coverage/coverage.json
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests