Skip to content

Commit

Permalink
Replace the rust program with a make command
Browse files Browse the repository at this point in the history
  • Loading branch information
JustusAdam committed Feb 21, 2024
1 parent 446e310 commit e553aa3
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 68 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Automated Documentation Update

on:
push:
branches: [ "main" ]
branches: [ "docs-via-make" ]

env:
CARGO_TERM_COLOR: always
Expand All @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: 'main'
ref: 'docs-via-make'
fetch-depth: 0
- name: Configure Git
run: |
Expand All @@ -27,11 +27,8 @@ jobs:
mkdir docs
cp -R target/doc docs/libs
rm -R .github
- name: Copy Rustc Docs
run: cargo run
working-directory: doc-src
- name: Copy index page
run: cp doc-src/index.html docs/index.html
- name: Copy rustc docs and index page
run: cargo make populate-doc-dir
- name: Commit Doc Generation
run: |
git add docs
Expand Down
14 changes: 14 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,17 @@ end
cd crates/paralegal-policy/tests/test-crate
exec cargo %{FORMAT_ARGS}
'''

[tasks.populate-doc-dir]
dependencies = ["get-rustc-docs"]
script_runner = "@duckscript"
script = '''
source_path = concat ${RUSTUP_HOME} /toolchains/ ${RUSTUP_TOOLCHAIN} /share/doc/rust/html/rustc
mkdir docs
mv doc-src/index.html docs
mv ${source_path} docs/compiler
'''

[tasks.get-rustc-docs]
command = "rustup"
args = ["component", "add", "rustc-docs"]
1 change: 0 additions & 1 deletion doc-src/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions doc-src/Cargo.lock

This file was deleted.

13 changes: 0 additions & 13 deletions doc-src/Cargo.toml

This file was deleted.

40 changes: 0 additions & 40 deletions doc-src/compose.rs

This file was deleted.

0 comments on commit e553aa3

Please sign in to comment.