-
-
Notifications
You must be signed in to change notification settings - Fork 89
110 lines (90 loc) · 3.05 KB
/
linux.yml
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
name: Linux
on:
push:
branches:
- master
pull_request:
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: short
jobs:
build-git:
runs-on: ubuntu-latest
strategy:
matrix:
# Use a tag from https://github.com/git/git/tags
# Make sure to update `git-version` in the `run-tests` step as well.
git-version: ["v2.24.3", "v2.29.2", "v2.33.1", "v2.37.3"]
steps:
- uses: actions/checkout@v4
with:
repository: git/git
ref: ${{ matrix.git-version }}
- uses: actions/cache@v4
id: cache-git-build
with:
key: ${{ runner.os }}-git-${{ matrix.git-version }}
path: |
git
git-*
- name: Build Git ${{ matrix.git-version }}
if: steps.cache-git-build.outputs.cache-hit != 'true'
run: |
sudo apt-get update --fix-missing
# List of dependencies from https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
sudo apt-get install dh-autoreconf libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev
make
- name: Package Git
run: tar -czf git.tar.gz git git-*
- name: "Upload artifact: git"
uses: actions/upload-artifact@v4
with:
name: git-${{ matrix.git-version }}
path: git.tar.gz
if-no-files-found: error
run-tests:
runs-on: ubuntu-latest
needs: build-git
strategy:
matrix:
git-version: ["v2.24.3", "v2.29.2", "v2.33.1", "v2.37.3"]
steps:
- uses: actions/checkout@v4
- name: "Download artifact: git"
uses: actions/download-artifact@v4
with:
name: git-${{ matrix.git-version }}
- name: "Unpack artifact: git"
run: tar -xf git.tar.gz
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.67.0
override: true
- name: Cache dependencies
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84
- name: Compile (all features)
run: cargo build --all-features --all-targets --workspace
# Don't test benches.
- name: Run Rust tests (all features)
timeout-minutes: 30
run: |
export TEST_GIT="$PWD"/git
export TEST_GIT_EXEC_PATH=$(dirname "$TEST_GIT")
cargo test --all-features --examples --tests --workspace
# Note that `--doc` can't be combined with other tests.
- name: Run Rust doc-tests (all features)
timeout-minutes: 30
run: |
export TEST_GIT="$PWD"/git
export TEST_GIT_EXEC_PATH=$(dirname "$TEST_GIT")
cargo test --all-features --doc --workspace
- name: Compile (no features)
run: cargo build --no-default-features --all-targets --workspace
- name: Run Rust tests (no default features)
timeout-minutes: 30
run: |
export TEST_GIT="$PWD"/git
export TEST_GIT_EXEC_PATH=$(dirname "$TEST_GIT")
cargo test --no-default-features --examples --tests --workspace