diff --git a/.github/workflows/canister-tests.yml b/.github/workflows/canister-tests.yml index 78564f4ff1..4af803ac1a 100644 --- a/.github/workflows/canister-tests.yml +++ b/.github/workflows/canister-tests.yml @@ -272,7 +272,9 @@ jobs: - uses: ./.github/actions/setup-node - name: "Build test app canister" working-directory: demos/test-app - run: ./build.sh + run: | + npm ci + ./build.sh - name: 'Upload test app' uses: actions/upload-artifact@v3 with: diff --git a/demos/test-app/lib.rs b/demos/test-app/lib.rs index 9a262a64cb..65f0fb0642 100644 --- a/demos/test-app/lib.rs +++ b/demos/test-app/lib.rs @@ -24,6 +24,7 @@ pub enum ContentType { HTML, JS, JSON, + CSS, } impl ContentType { @@ -32,6 +33,7 @@ impl ContentType { ContentType::HTML => "text/html".to_string(), ContentType::JS => "text/javascript".to_string(), ContentType::JSON => "application/json".to_string(), + ContentType::CSS => "text/css".to_string(), } } } @@ -227,16 +229,26 @@ lazy_static! { // Get all the assets. Duplicated assets like index.html are shared and generally all assets are // prepared only once (like injecting the canister ID). -fn get_assets() -> [(&'static str, &'static [u8], ContentType); 5] { +fn get_assets() -> [(&'static str, &'static [u8], ContentType); 7] { let index_html: &[u8] = INDEX_HTML_STR.as_bytes(); [ ("/", index_html, ContentType::HTML), ("/index.html", index_html, ContentType::HTML), + ( + "/index.css", + include_bytes!("dist/index.css"), + ContentType::CSS, + ), ( "/index.js", include_bytes!("dist/index.js"), ContentType::JS, ), + ( + "/index2.js", + include_bytes!("dist/index2.js"), + ContentType::JS, + ), // initially empty alternative origins, but can be populated using the update_alternative_origins call ( "/.well-known/ii-alternative-origins",