Skip to content

Commit b7d6be8

Browse files
authored
Frontend CI (#51)
## Motivation We currently don't test the frontend build in CI. ## Proposal Test it. Also, use the Nix flake to make sure we have all the dependencies instead of reproducing our dependency list in our GitHub actions. ## Test Plan This PR!
1 parent 6f43173 commit b7d6be8

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

.github/workflows/main.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,10 @@ jobs:
1515
backend:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- name: 'Checkout'
19-
uses: actions/checkout@v3
20-
21-
- name: 'Install Rust toolchain'
22-
uses: actions-rust-lang/setup-rust-toolchain@v1
23-
24-
- name: 'Install Protoc'
25-
uses: arduino/setup-protoc@v3
26-
with:
27-
repo-token: ${{ secrets.GITHUB_TOKEN }}
18+
- uses: actions/checkout@v3
19+
- uses: DeterminateSystems/nix-installer-action@main
20+
- uses: DeterminateSystems/magic-nix-cache-action@main
21+
- uses: nicknovitski/nix-develop@v1
2822

2923
- name: 'Install linera-storage-service'
3024
uses: taiki-e/cache-cargo-install-action@v2
@@ -60,6 +54,20 @@ jobs:
6054
- name: 'Verify that code-generated files are unchanged'
6155
run: git diff --exit-code
6256

57+
frontend:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v3
61+
- uses: DeterminateSystems/nix-installer-action@main
62+
- uses: DeterminateSystems/magic-nix-cache-action@main
63+
- uses: nicknovitski/nix-develop@v1
64+
65+
- name: Build frontend
66+
run: |
67+
cd frontend
68+
pnpm install
69+
pnpm build
70+
6371
lint-cargo-fmt:
6472
runs-on: ubuntu-latest
6573
steps:

flake.nix

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,33 @@
2828
inputsFrom = [
2929
config.treefmt.build.devShell
3030
];
31-
31+
3232
buildInputs = with pkgs; [
3333
# Frontend dependencies
3434
nodejs
3535
pnpm
36-
36+
3737
# Rust toolchain from rust-toolchain.toml
3838
(rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
39-
40-
# Build tools
39+
40+
# Linera dependencies
4141
pkg-config
4242
openssl
4343
protobuf
44-
44+
clang
45+
clang.cc.lib
46+
libiconv
47+
4548
# Deployment tools
4649
google-cloud-sdk
47-
50+
4851
# Development tools
4952
jq
5053
];
51-
54+
5255
shellHook = ''
5356
export PATH=$PWD/target/debug:$PATH
57+
export LIBCLANG_PATH="${pkgs.clang.cc.lib}/lib"
5458
echo "Game of Life Challenge development environment"
5559
echo "- Frontend: cd frontend && pnpm install && pnpm build"
5660
echo "- Backend: cargo build"
@@ -66,4 +70,4 @@
6670
};
6771
};
6872
};
69-
}
73+
}

0 commit comments

Comments
 (0)