-
Notifications
You must be signed in to change notification settings - Fork 4
chore: add ci and fix some trivial problem #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,61 @@ | ||||||||||||||||||||||||||||||||
| name: CI | ||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||
| ZIG_VERSION: 0.14.1 | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||
| include: | ||||||||||||||||||||||||||||||||
| # macOS builds | ||||||||||||||||||||||||||||||||
| - os: macos-latest | ||||||||||||||||||||||||||||||||
| target: aarch64-macos-none | ||||||||||||||||||||||||||||||||
| - os: macos-latest | ||||||||||||||||||||||||||||||||
| target: x86_64-macos-none | ||||||||||||||||||||||||||||||||
| # Linux builds | ||||||||||||||||||||||||||||||||
| - os: ubuntu-latest | ||||||||||||||||||||||||||||||||
| target: aarch64-linux-gnu | ||||||||||||||||||||||||||||||||
| - os: ubuntu-latest | ||||||||||||||||||||||||||||||||
| target: x86_64-linux-gnu | ||||||||||||||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||||||||||||||
| runs-on: ${{matrix.os}} | ||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Setup Zig | ||||||||||||||||||||||||||||||||
| id: setup-zig | ||||||||||||||||||||||||||||||||
| uses: mlugg/setup-zig@v2 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| version: ${{ env.ZIG_VERSION }} | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Cache Zig installation | ||||||||||||||||||||||||||||||||
| uses: actions/cache@v3 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| path: ${{ steps.setup-zig.outputs.install-path }} | ||||||||||||||||||||||||||||||||
| key: ${{ runner.os }}-zig-${{ env.ZIG_VERSION }} | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Cache Zig build artifacts | ||||||||||||||||||||||||||||||||
| uses: actions/cache@v3 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| path: | | ||||||||||||||||||||||||||||||||
| zig-cache | ||||||||||||||||||||||||||||||||
| ~/.cache/zig | ||||||||||||||||||||||||||||||||
| key: ${{ runner.os }}-${{ matrix.target }}-zig-build-${{ hashFiles('build.zig', 'build.zig.zon') }} | ||||||||||||||||||||||||||||||||
| restore-keys: | | ||||||||||||||||||||||||||||||||
| ${{ runner.os }}-${{ matrix.target }}-zig-build- | ||||||||||||||||||||||||||||||||
|
Comment on lines
+37
to
+51
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think for such a small build, we don't really need to cache these. |
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Formatting | ||||||||||||||||||||||||||||||||
| run: zig fmt --check . | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| # TODO: uncomment when tests are implemented | ||||||||||||||||||||||||||||||||
| # - name: Unit testing | ||||||||||||||||||||||||||||||||
| # run: zig build test -Dtarget=${{matrix.target}} --summary all | ||||||||||||||||||||||||||||||||
|
Comment on lines
+56
to
+58
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think we can do without these if it's going to be commented out anyway. |
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Building | ||||||||||||||||||||||||||||||||
| run: zig build -Dtarget=${{matrix.target}} -Doptimize=ReleaseFast --summary all | ||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Let's try to default to |
||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,10 @@ pub fn build(b: *std.Build) void { | |
| .target = target, | ||
| .optimize = optimize, | ||
| }); | ||
| const zlib = b.dependency("zlib", .{ | ||
| .target = target, | ||
| .optimize = optimize, | ||
| }); | ||
|
|
||
| const ssl = boringssl.artifact("ssl"); | ||
| const crypto = boringssl.artifact("crypto"); | ||
|
|
@@ -41,6 +45,8 @@ pub fn build(b: *std.Build) void { | |
|
|
||
| lib.linkLibrary(ssl); | ||
| lib.linkLibrary(crypto); | ||
| lib.linkLibrary(zlib.artifact("z")); | ||
| lib.addIncludePath(zlib.path("src")); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The include path for To fix this, you should point to the root of the dependency.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure about this, since if there's no these lines in build.zig, the local container building would fail. @GrapeBaBa @spiral-ladder
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you mean
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What is the error message? |
||
| lib.addIncludePath(lshpack_dep.path("deps/xxhash")); | ||
| lib.addIncludePath(lsqpack_dep.path("deps/xxhash")); | ||
| lib.addIncludePath(lshpack_dep.path("")); | ||
|
|
@@ -152,5 +158,4 @@ const lsquic_files: []const []const u8 = &.{ | |
| "lsquic_varint.c", | ||
| "lsquic_version.c", | ||
| "lsquic_xxhash.c", | ||
| "lsquic_global.c", | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we try to add a windows target to test