Skip to content

Commit

Permalink
Add build-index workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Folyd committed Jun 29, 2024
1 parent f261820 commit 843c47b
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 52 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build-index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build index
on:
workflow_dispatch:

jobs:
build:
name: Build index
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Build index"
run: |
cd rust
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=Cargo.toml books -d /tmp/books.js
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=Cargo.toml lints -d /tmp/lints.js
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=Cargo.toml labels -d /tmp/labels.js
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=Cargo.toml rustc -d /tmp/rustc.js
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=Cargo.toml targets -d /tmp/targets.js
git clone --depth 1 https://github.com/jplatte/caniuse.rs.git /tmp/caniuse
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=Cargo.toml caniuse -r /tmp/caniuse -d /tmp/caniuse.js
git clone --depth 1 https://github.com/nrc/rfc-index.git /tmp/rfc-index
RUST_BACKTRACE=full cargo run --target-dir /tmp --manifest-path=Cargo.toml rfcs -r /tmp/rfc-index -d /tmp/rfcs.js
zip /tmp/index.zip /tmp/*.js
- name: "Upload Index Artifact"
uses: actions/upload-artifact@master
with:
name: index.zip
path: /tmp/index.zip

File renamed without changes.
1 change: 0 additions & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ semver = { version = "1", features = ["serde"] }
rayon = "1"
regex = "1"
argh = "0.1"
rustsec = "0"
html-escape = "0"
db-dump = "0.7.1"
2 changes: 0 additions & 2 deletions rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ struct Options {
#[argh(subcommand)]
#[non_exhaustive]
enum Subcommand {
Advisory(AdvisoryTask),
Crates(CratesTask),
Books(BooksTask),
Caniuse(CaniuseTask),
Expand All @@ -36,7 +35,6 @@ pub type Result<T> = std::result::Result<T, Box<dyn Error>>;
fn main() -> Result<()> {
let options: Options = argh::from_env();
match options.subcommand {
Subcommand::Advisory(cmd) => cmd.execute()?,
Subcommand::Crates(cmd) => cmd.execute()?,
Subcommand::Books(cmd) => cmd.execute()?,
Subcommand::Caniuse(cmd) => cmd.execute()?,
Expand Down
46 changes: 0 additions & 46 deletions rust/src/tasks/advisory.rs

This file was deleted.

4 changes: 3 additions & 1 deletion rust/src/tasks/crates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ impl Task for CratesTask {
return;
}
// Filter out aws_sdk crates and auto-generated google api crates.
if row.id.starts_with("aws_sdk_") || row.description.starts_with(GOOGLE_API_CRATES_FILTER_PREFIX) {
if row.name.starts_with("aws_sdk_")
|| row.description.starts_with(GOOGLE_API_CRATES_FILTER_PREFIX)
{
return;
}
crates.push(Crate {
Expand Down
2 changes: 0 additions & 2 deletions rust/src/tasks/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pub use advisory::AdvisoryTask;
pub use books::BooksTask;
pub use caniuse::CaniuseTask;
pub use crates::CratesTask;
Expand All @@ -8,7 +7,6 @@ pub use rfcs::RfcsTask;
pub use rustc::RustcTask;
pub use targets::TargetsTask;

mod advisory;
mod books;
mod caniuse;
mod crates;
Expand Down

0 comments on commit 843c47b

Please sign in to comment.