Skip to content

Commit 6c5d199

Browse files
committed
Update deploy CI
This updates all the deploy scripts and the deploy workflow. The deploy workflow now runs the metadata collector to collect the lint documentation. It also changes the files that are checked out in the deploy workflow from master and adds an explanation why we have to do this.
1 parent ac0fd99 commit 6c5d199

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

.github/deploy.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ rm -rf out/master/ || exit 0
88
echo "Making the docs for master"
99
mkdir out/master/
1010
cp util/gh-pages/index.html out/master
11-
python3 ./util/export.py out/master/lints.json
11+
cp util/gh-pages/lints.json out/master
1212

1313
if [[ -n $TAG_NAME ]]; then
1414
echo "Save the doc for the current tag ($TAG_NAME) and point stable/ to it"
15-
cp -r out/master "out/$TAG_NAME"
16-
rm -f out/stable
17-
ln -s "$TAG_NAME" out/stable
15+
cp -Tr out/master "out/$TAG_NAME"
16+
ln -sf "$TAG_NAME" out/stable
1817
fi
1918

2019
if [[ $BETA = "true" ]]; then
@@ -28,8 +27,8 @@ cp util/gh-pages/versions.html out/index.html
2827
echo "Making the versions.json file"
2928
python3 ./util/versions.py out
3029

31-
cd out
3230
# Now let's go have some fun with the cloned repo
31+
cd out
3332
git config user.name "GHA CI"
3433
git config user.email "[email protected]"
3534

.github/workflows/deploy.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,23 @@ jobs:
3939
if: github.ref == 'refs/heads/beta'
4040
run: echo "BETA=true" >> $GITHUB_ENV
4141

42-
- name: Use scripts and templates from master branch
42+
# We need to check out all files that (transitively) depend on the
43+
# structure of the gh-pages branch, so that we're able to change that
44+
# structure without breaking the deployment.
45+
- name: Use deploy files from master branch
4346
run: |
4447
git fetch --no-tags --prune --depth=1 origin master
45-
git checkout origin/master -- .github/deploy.sh util/gh-pages/ util/*.py
48+
git checkout origin/master -- .github/deploy.sh util/versions.py util/gh-pages/versions.html
49+
50+
# Generate lockfile for caching to avoid build problems with cached deps
51+
- name: cargo generate-lockfile
52+
run: cargo generate-lockfile
53+
54+
- name: Cache
55+
uses: Swatinem/[email protected]
56+
57+
- name: cargo collect-metadata
58+
run: cargo collect-metadata
4659

4760
- name: Deploy
4861
run: |

clippy_lints/src/utils/internal_lints/metadata_collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use clippy_utils::{
3232
};
3333

3434
/// This is the output file of the lint collector.
35-
const OUTPUT_FILE: &str = "../util/gh-pages/metadata_collection.json";
35+
const OUTPUT_FILE: &str = "../util/gh-pages/lints.json";
3636
/// These lints are excluded from the export.
3737
const BLACK_LISTED_LINTS: [&str; 3] = ["lint_author", "deep_code_inspection", "internal_metadata_collector"];
3838
/// These groups will be ignored by the lint group matcher. This is useful for collections like

tests/dogfood.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ fn run_metadata_collection_lint() {
183183
use std::time::SystemTime;
184184

185185
// Setup for validation
186-
let metadata_output_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("util/gh-pages/metadata_collection.json");
186+
let metadata_output_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("util/gh-pages/lints.json");
187187
let start_time = SystemTime::now();
188188

189189
// Run collection as is

0 commit comments

Comments
 (0)