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
# uncomment test job when we have self hosted github action runners or enough minutes limit
name: tests
on:
pull_request:
push:
branches:
- "master"
# schedule:
# - cron: "00 00 */2 * *"
permissions:
contents: read
jobs:
# test:
# name: test
# env:
# CARGO: cargo
# TARGET_FLAGS:
# TARGET_DIR: ./target
# CROSS_VERSION: v0.2.5
# RUST_BACKTRACE: 1
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# include:
# - build: stable-musl
# os: ubuntu-latest
# rust: stable
# target: x86_64-unknown-linux-musl
# - build: macos
# os: macos-latest
# rust: nightly
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# - name: Install packages (Ubuntu)
# if: matrix.os == 'ubuntu-latest'
# run: |
# scripts/ubuntu-install-dependencies
# - name: Install Rust
# uses: dtolnay/rust-toolchain@master
# with:
# toolchain: ${{ matrix.rust }}
# - name: Use Cross
# if: matrix.os == 'ubuntu-latest' && matrix.target != ''
# shell: bash
# run: |
# dir="$RUNNER_TEMP/cross-download"
# mkdir "$dir"
# echo "$dir" >> $GITHUB_PATH
# cd "$dir"
# curl -LO "https://github.com/cross-rs/cross/releases/download/$CROSS_VERSION/cross-x86_64-unknown-linux-musl.tar.gz"
# tar xf cross-x86_64-unknown-linux-musl.tar.gz
# echo "CARGO=cross" >> $GITHUB_ENV
# - name: Show command used for Cargo
# run: |
# echo "cargo command is: ${{ env.CARGO }}"
# echo "target flag is: ${{ env.TARGET_FLAGS }}"
# echo "target dir is: ${{ env.TARGET_DIR }}"
# - name: Build http-diff
# run: ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }}
# - name: Show build.rs stderr
# shell: bash
# run: |
# set +x
# stderr="$(find "${{ env.TARGET_DIR }}/release" -name stderr -print0 | xargs -0 ls -t | head -n1)"
# if [ -s "$stderr" ]; then
# echo "===== $stderr ===== "
# cat "$stderr"
# echo "====="
# fi
# set -x
# - name: Run tests
# run: ${{ env.CARGO }} test --verbose ${{ env.TARGET_FLAGS }}
rustfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- name: Check formatting
run: cargo fmt --all --check