Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3080a58c4a | ||
|
|
b12c83e8b5 | ||
|
|
ff4e2a5c5d | ||
|
|
2ef9f80fc1 | ||
|
|
6fe549e34e |
+13
-72
@@ -2,6 +2,11 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
# CI for the self-hosted, host-executor Podman runners (see container/).
|
||||||
|
# The runner image bakes in the Rust toolchain and all build dependencies,
|
||||||
|
# so jobs go straight to cargo — no apt/rustup setup steps (which also
|
||||||
|
# collided on the dpkg lock when jobs ran concurrently in the same runner).
|
||||||
|
|
||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -17,90 +22,26 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install system dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y --no-install-recommends \
|
|
||||||
build-essential pkg-config cmake clang libclang-dev \
|
|
||||||
libopus-dev libasound2-dev libsoapysdr-dev
|
|
||||||
|
|
||||||
- name: Set up Rust
|
|
||||||
run: |
|
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
|
||||||
if ! command -v rustup >/dev/null 2>&1; then
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
|
||||||
| sh -s -- -y --profile minimal
|
|
||||||
fi
|
|
||||||
rustup toolchain install stable --profile minimal \
|
|
||||||
--component rustfmt --component clippy
|
|
||||||
rustup default stable
|
|
||||||
|
|
||||||
- name: Cache cargo
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry
|
|
||||||
~/.cargo/git
|
|
||||||
target
|
|
||||||
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
restore-keys: cargo-${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: rustfmt
|
- name: rustfmt
|
||||||
run: |
|
run: cargo fmt --all -- --check
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
|
||||||
cargo fmt --all -- --check
|
|
||||||
|
|
||||||
- name: clippy
|
- name: clippy
|
||||||
run: |
|
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
|
||||||
cargo clippy --workspace --all-targets --all-features -- -D warnings
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install system dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y --no-install-recommends \
|
|
||||||
build-essential pkg-config cmake clang libclang-dev \
|
|
||||||
libopus-dev libasound2-dev libsoapysdr-dev
|
|
||||||
|
|
||||||
- name: Set up Rust
|
|
||||||
run: |
|
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
|
||||||
if ! command -v rustup >/dev/null 2>&1; then
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
|
||||||
| sh -s -- -y --profile minimal
|
|
||||||
fi
|
|
||||||
rustup toolchain install stable --profile minimal
|
|
||||||
rustup default stable
|
|
||||||
|
|
||||||
- name: Cache cargo
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry
|
|
||||||
~/.cargo/git
|
|
||||||
target
|
|
||||||
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
restore-keys: cargo-${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: cargo build --workspace --all-targets --locked
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
|
||||||
cargo build --workspace --all-targets --locked
|
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: cargo test --workspace --locked
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
|
||||||
cargo test --workspace --locked
|
|
||||||
|
|
||||||
reuse:
|
reuse:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: REUSE compliance
|
- name: REUSE compliance
|
||||||
uses: fsfe/reuse-action@v5
|
# `reuse` CLI instead of fsfe/reuse-action: the latter is a Docker
|
||||||
|
# action, which the host-executor runners cannot run. `reuse` is baked
|
||||||
|
# into the runner image (see container/Containerfile).
|
||||||
|
run: reuse lint
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_MAJOR}.x | bash - \
|
|||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# REUSE >= 3 (Debian's packaged reuse is too old for REUSE.toml).
|
# REUSE >= 3 (Debian's packaged reuse is too old for REUSE.toml).
|
||||||
RUN PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install reuse
|
# The [charset-normalizer] extra provides an encoding-detection backend;
|
||||||
|
# without it (and without libmagic) reuse fails to import at runtime.
|
||||||
|
RUN PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install 'reuse[charset-normalizer]'
|
||||||
|
|
||||||
# Rust stable with rustfmt + clippy, installed system-wide.
|
# Rust stable with rustfmt + clippy, installed system-wide.
|
||||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
||||||
|
|||||||
@@ -1624,6 +1624,8 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script defer src="https://cdn.jsdelivr.net/npm/opus-decoder@0.7.11/dist/opus-decoder.min.js" charset="UTF-8"></script>
|
<script defer src="https://cdn.jsdelivr.net/npm/opus-decoder@0.7.11/dist/opus-decoder.min.js" charset="UTF-8"></script>
|
||||||
|
<script defer src="/vendor/leaflet.js"></script>
|
||||||
|
<script defer src="/leaflet-ais-tracksymbol.js"></script>
|
||||||
<script defer src="/webgl-renderer.js"></script>
|
<script defer src="/webgl-renderer.js"></script>
|
||||||
<script defer src="/app.js"></script>
|
<script defer src="/app.js"></script>
|
||||||
<script>
|
<script>
|
||||||
@@ -1632,41 +1634,67 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
|||||||
var pluginScripts = {
|
var pluginScripts = {
|
||||||
'digital-modes': ['/ft8.js', '/ft4.js', '/ft2.js', '/wspr.js', '/cw.js', '/background-decode.js', '/sat.js', '/wefax.js'],
|
'digital-modes': ['/ft8.js', '/ft4.js', '/ft2.js', '/wspr.js', '/cw.js', '/background-decode.js', '/sat.js', '/wefax.js'],
|
||||||
'map-data': ['/map-core.js', '/ais.js', '/vdes.js', '/aprs.js', '/hf-aprs.js'],
|
'map-data': ['/map-core.js', '/ais.js', '/vdes.js', '/aprs.js', '/hf-aprs.js'],
|
||||||
'map': ['/map-core.js', '/leaflet-ais-tracksymbol.js', '/ais.js', '/vdes.js', '/aprs.js', '/hf-aprs.js', '/sat.js', '/sat-scheduler.js'],
|
'map': ['/map-core.js', '/ais.js', '/vdes.js', '/aprs.js', '/hf-aprs.js', '/sat.js', '/sat-scheduler.js'],
|
||||||
'statistics': ['/map-core.js'],
|
'statistics': ['/map-core.js'],
|
||||||
'bookmarks': ['/bookmarks.js'],
|
'bookmarks': ['/bookmarks.js'],
|
||||||
'recorder': [],
|
'recorder': [],
|
||||||
'settings': ['/vchan.js', '/scheduler.js']
|
'settings': ['/vchan.js', '/scheduler.js']
|
||||||
};
|
};
|
||||||
var loaded = new Set();
|
var loaded = new Set();
|
||||||
function loadPlugins(tab) {
|
var loading = new Map();
|
||||||
var scripts = pluginScripts[tab];
|
|
||||||
if (!scripts) return;
|
function loadScript(src) {
|
||||||
scripts.forEach(function(src) {
|
if (loaded.has(src)) return Promise.resolve();
|
||||||
if (loaded.has(src)) return;
|
if (loading.has(src)) return loading.get(src);
|
||||||
loaded.add(src);
|
|
||||||
|
var request = new Promise(function(resolve, reject) {
|
||||||
var s = document.createElement('script');
|
var s = document.createElement('script');
|
||||||
s.src = src;
|
s.src = src;
|
||||||
s.defer = true;
|
s.onload = function() {
|
||||||
|
loaded.add(src);
|
||||||
|
loading.delete(src);
|
||||||
|
resolve();
|
||||||
|
};
|
||||||
|
s.onerror = function() {
|
||||||
|
loading.delete(src);
|
||||||
|
reject(new Error('Failed to load plugin script: ' + src));
|
||||||
|
};
|
||||||
document.body.appendChild(s);
|
document.body.appendChild(s);
|
||||||
});
|
});
|
||||||
|
loading.set(src, request);
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadPlugins(tab) {
|
||||||
|
var scripts = pluginScripts[tab];
|
||||||
|
if (!scripts) return Promise.resolve();
|
||||||
|
return scripts.reduce(function(sequence, src) {
|
||||||
|
return sequence.then(function() { return loadScript(src); });
|
||||||
|
}, Promise.resolve());
|
||||||
|
}
|
||||||
|
|
||||||
|
function requestPlugins(tab) {
|
||||||
|
return loadPlugins(tab).catch(function(err) {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// Eager plugin loading is triggered by app.js (after window.trx is set up)
|
// Eager plugin loading is triggered by app.js (after window.trx is set up)
|
||||||
// via window.loadEagerPlugins(). Dynamic scripts are effectively async, so
|
// via window.loadEagerPlugins(). Dynamic scripts are effectively async, so
|
||||||
// loading them before app.js would cause map-core.js to crash when
|
// loading them before app.js would cause map-core.js to crash when
|
||||||
// window.trx is not yet defined.
|
// window.trx is not yet defined.
|
||||||
window.loadEagerPlugins = function() {
|
window.loadEagerPlugins = function() {
|
||||||
['digital-modes', 'map-data', 'bookmarks', 'settings'].forEach(loadPlugins);
|
return Promise.all(
|
||||||
|
['digital-modes', 'map-data', 'bookmarks', 'settings'].map(requestPlugins)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
// Load others on tab switch
|
// Load others on tab switch
|
||||||
document.addEventListener('click', function(e) {
|
document.addEventListener('click', function(e) {
|
||||||
var tab = e.target.closest('[data-tab]');
|
var tab = e.target.closest('[data-tab]');
|
||||||
if (tab) loadPlugins(tab.dataset.tab);
|
if (tab) requestPlugins(tab.dataset.tab);
|
||||||
});
|
});
|
||||||
window.loadPluginsForTab = loadPlugins;
|
window.loadPluginsForTab = loadPlugins;
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
<!-- Template cloning is handled by navigateToTab() in app.js -->
|
<!-- Template cloning is handled by navigateToTab() in app.js -->
|
||||||
<script defer src="/vendor/leaflet.js"></script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user