cargo & npm: additional updates via dependabot #390
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: | |
- main | |
- release | |
- release-candidate | |
- ci | |
pull_request: | |
permissions: read-all | |
env: | |
CARGO_INCREMENTAL: 0 | |
CARGO_PROFILE_DEV_DEBUG: 0 | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
# macos-13 is x86; macos-14 is ARM | |
os: [ubuntu-latest, macos-13, macos-14, windows-latest] | |
cargo_flags: [""] | |
include: | |
- os: ubuntu-latest | |
cargo_flags: "--all-features" | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 | |
with: | |
toolchain: 1.81 | |
- name: Build diffedit3-web (but not Tauri diffedit3-gui, which has "gdk-3.0" runtime dependecy ) | |
run: cargo build -p diffedit3 --all-targets --verbose ${{ matrix.cargo_flags }} | |
- name: Test | |
run: cargo test -p diffedit3 --all-targets --verbose ${{ matrix.cargo_flags }} | |
env: | |
RUST_BACKTRACE: 1 | |
check-formatting-and-dist-up-to-date: | |
name: Check that webapp was compiled | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
- name: Remove old version of comiled and bundled JS | |
shell: bash | |
run: rm -rv webapp/dist | |
- name: install frontend dependencies | |
run: npm clean-install | |
- name: build | |
run: npm run build # Also runs `npm run format` | |
- name: Check for uncommitted changes | |
shell: bash | |
run: | | |
git add -N . # `git diff` ignores added files without this | |
if git diff --stat --exit-code; then | |
echo "OK, building and reformatting the webapp did not cause any changes." | |
else | |
echo | |
echo 'Updates to the webapp were not bundled to webapp/dist/' | |
echo 'or `prettier` was not run to reformat webapp files.' | |
echo | |
echo 'Please run:' | |
echo ' npm clean-install && npm run build' | |
exit 1 | |
fi | |
clippy: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 | |
with: | |
toolchain: 1.81 | |
components: clippy | |
- name: install dependencies (ubuntu + Tauri only) | |
run: ./.github/scripts/ubuntu_install_tauri_dependencies.sh | |
- name: Clippy | |
run: cargo clippy --workspace --all-targets --verbose | |
rustfmt: | |
name: Check formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 | |
- uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 | |
with: | |
toolchain: nightly | |
components: rustfmt | |
- run: cargo +nightly fmt --all -- --check |