File tree Expand file tree Collapse file tree 6 files changed +73
-16
lines changed Expand file tree Collapse file tree 6 files changed +73
-16
lines changed Original file line number Diff line number Diff line change
1
+ name : Setup Apt and Install Packages
2
+ description : Configures apt, runs update once per job, and installs packages.
3
+
4
+ inputs :
5
+ packages :
6
+ description : A space-separated list of packages to install.
7
+ required : true
8
+
9
+ runs :
10
+ using : composite
11
+ steps :
12
+ - name : Configure dpkg and apt for CI
13
+ shell : bash
14
+ run : |
15
+ # Avoid time-consuming man-db updates.
16
+ sudo tee /etc/dpkg/dpkg.cfg.d/99-no-doc > /dev/null <<EOF
17
+ path-exclude /usr/share/doc/*
18
+ path-exclude /usr/share/man/*
19
+ path-exclude /usr/share/info/*
20
+ EOF
21
+
22
+ # Exclude translations.
23
+ sudo tee /etc/apt/apt.conf.d/99-no-translations > /dev/null <<EOF
24
+ Acquire::Languages "none";
25
+ EOF
26
+
27
+ # Exclude command-not-found utility.
28
+ sudo rm -f /etc/apt/apt.conf.d/50command-not-found
29
+
30
+ # Remove unnecessary repository lists (we don't install Azure
31
+ # utilities)
32
+ sudo rm -f /etc/apt/sources.list.d/microsoft-prod.* /etc/apt/sources.list.d/azure-cli.*
33
+
34
+ - name : Run apt-get update
35
+ if : env.APT_UPDATED != 'true'
36
+ shell : bash
37
+ run : |
38
+ sudo apt-get update
39
+ echo "APT_UPDATED=true" >> $GITHUB_ENV
40
+
41
+ - name : Installing ${{ inputs.packages }}
42
+ shell : bash
43
+ run : |
44
+ sudo apt-get install --quiet --yes ${{ inputs.packages }}
Original file line number Diff line number Diff line change 62
62
uses : ./.github/workflows/setup-rust-cache
63
63
64
64
- name : Install dependencies
65
- run : |
66
- sudo apt update
67
- sudo apt install gcc-aarch64-linux-gnu
65
+ uses : ./.github/workflows/apt-get-install
66
+ with :
67
+ packages : gcc-aarch64-linux-gnu
68
68
69
69
- name : Build Rust code
70
70
working-directory : ${{ matrix.directory }}
@@ -113,10 +113,10 @@ jobs:
113
113
with :
114
114
key : ${{ contains(fromJSON(env.LINK_CHECKED_LANGUAGES), matrix.language) }}
115
115
116
- - name : Install Gettext
117
- run : |
118
- sudo apt update
119
- sudo apt install gettext
116
+ - name : Install dependencies
117
+ uses : ./.github/workflows/apt-get-install
118
+ with :
119
+ packages : gettext
120
120
121
121
- name : Install mdbook
122
122
uses : ./.github/workflows/install-mdbook
Original file line number Diff line number Diff line change @@ -12,10 +12,13 @@ runs:
12
12
run : cargo xtask install-tools --binstall
13
13
shell : bash
14
14
15
- - name : Install dependencies for mdbook-pandoc
15
+ - name : Install mdbook-pandoc dependencies
16
+ uses : ./.github/workflows/apt-get-install
17
+ with :
18
+ packages : texlive texlive-luatex texlive-lang-cjk texlive-lang-arabic librsvg2-bin fonts-noto
19
+
20
+ - name : Install mdbook-pandoc
16
21
run : |
17
- sudo apt-get update
18
- sudo apt-get install -y texlive texlive-luatex texlive-lang-cjk texlive-lang-arabic librsvg2-bin fonts-noto
19
22
curl -LsSf https://github.com/jgm/pandoc/releases/download/3.7.0.1/pandoc-3.7.0.1-linux-amd64.tar.gz | tar zxf -
20
23
echo "$PWD/pandoc-3.7.0.1/bin" >> $GITHUB_PATH
21
24
shell : bash
Original file line number Diff line number Diff line change 31
31
uses : actions/checkout@v5
32
32
33
33
- name : Install formatting dependencies
34
- run : |
35
- sudo apt update
36
- sudo apt install gettext yapf3
34
+ uses : ./.github/workflows/apt-get-install
35
+ with :
36
+ packages : gettext yapf3
37
37
38
38
- name : Install pinned nightly for rustfmt
39
39
run : |
Original file line number Diff line number Diff line change 42
42
uses : ./.github/workflows/setup-rust-cache
43
43
44
44
- name : Install Gettext
45
- run : |
46
- sudo apt update
47
- sudo apt install gettext
45
+ uses : ./.github/workflows/apt-get-install
46
+ with :
47
+ packages : gettext
48
48
49
49
- name : Install mdbook
50
50
uses : ./.github/workflows/install-mdbook
Original file line number Diff line number Diff line change @@ -80,6 +80,16 @@ list of options.
80
80
- ** Contributions:** Refer to ` CONTRIBUTING.md ` for guidelines on contributing
81
81
to the project.
82
82
- ** Style:** Refer to ` STYLE.md ` for style guidelines.
83
+ - ** GitHub Actions:** The project uses composite GitHub Actions to simplify CI
84
+ workflows. These actions should be preferred over hand-written commands.
85
+ - ** ` apt-get-install ` :** This action efficiently installs Debian packages. It
86
+ configures ` dpkg ` and ` apt ` to skip documentation and translations, and
87
+ ensures that ` apt-get update ` is run only once per job. This significantly
88
+ speeds up CI runs.
89
+ - ** ` install-mdbook ` :** A composite action to install ` mdbook ` and its
90
+ dependencies, including ` pandoc ` and ` texlive ` .
91
+ - ** ` setup-rust-cache ` :** A composite action that configures the
92
+ ` Swatinem/rust-cache ` action.
83
93
84
94
## Markdown Conventions
85
95
You can’t perform that action at this time.
0 commit comments