-
Notifications
You must be signed in to change notification settings - Fork 5
61 lines (52 loc) · 1.74 KB
/
standard-tests.yml
File metadata and controls
61 lines (52 loc) · 1.74 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
name: Standard Tests
on:
push:
branches: [ "master", "stable" ]
pull_request:
branches: [ "master", "stable" ]
env:
CARGO_TERM_COLOR: always
concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true
jobs:
basic-tests:
strategy:
fail-fast: false
matrix:
include:
- platform: 'ubuntu-22.04'
args: ''
- platform: 'windows-latest'
args: ''
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: install rustup & toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
# Manually detect if locale files has been changed,
# so that we can trigger locale file check later.
# This check is too simple thus I don't think it worth having a dedicated workflow.
- name: Check if locale files changed
id: check_locales
run: |
git fetch origin ${{ github.event.before }} --depth=1
CHANGED=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '^locales/' || true)
CHANGED=$(echo "$CHANGED" | tr '\n' ',')
echo "changed=$CHANGED" >> "$GITHUB_OUTPUT"
shell: bash
- name: formatting check
run: cargo fmt --all --check
- name: Run locale-specific tests
if: steps.check_locales.outputs.changed != ''
run: cargo dev locale check
- name: clippy check
run: cargo clippy --no-deps --workspace --exclude rim-gui -- -D warnings
- name: build
run: cargo build --workspace --exclude rim-gui --verbose
- name: run tests
run: cargo test --workspace --exclude rim-gui --verbose
env:
RUST_BACKTRACE: full