-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
232 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[string]$Runner | ||
) | ||
|
||
$global:ProtoCompilerVersion = "27.2" | ||
|
||
function Get-Link | ||
{ | ||
$baseUrl = "https://github.com/protocolbuffers/protobuf/releases/download/v$global:ProtoCompilerVersion/protoc" | ||
switch ($Runner) | ||
{ | ||
"ubuntu-latest" { | ||
return "$baseUrl-$global:ProtoCompilerVersion-linux-x86_64.zip" | ||
} | ||
|
||
"windows-latest" { | ||
return "$baseUrl-$global:ProtoCompilerVersion-win64.zip" | ||
} | ||
|
||
"macos-latest" { | ||
return "$baseUrl-$global:ProtoCompilerVersion-osx-universal_binary.zip" | ||
} | ||
|
||
default { | ||
throw "unsupported runner '{$Runner}'" | ||
} | ||
} | ||
} | ||
|
||
$link = Get-Link | ||
$filename = "protobuf-compiler" | ||
Invoke-WebRequest -Uri $link -OutFile "$filename.zip" | ||
[System.IO.Compression.ZipFile]::ExtractToDirectory("$filename.zip", $filename) | ||
|
||
$protobufBinDir = (Get-Item -Path "protobuf-compiler/bin").FullName | ||
|
||
"protoc_bin=$protobufBinDir" | Out-File -FilePath $env:GITHUB_OUTPUT -Append |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Rust | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
|
||
pull_request: | ||
branches: | ||
- "master" | ||
|
||
schedule: | ||
- cron: '0 3 * * 0' # Every sunday at 3am UTC. | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
continue-on-error: true | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download and configure dependencies | ||
id: configure | ||
shell: pwsh | ||
run: .github/scripts/setup.ps1 -Runner ${{ matrix.os }} | ||
|
||
- name: Update system path | ||
shell: pwsh | ||
run: | | ||
"${{ steps.configure.outputs.protoc_bin }}" | Out-File -FilePath $env:GITHUB_PATH -Append | ||
- name: Build | ||
run: cargo check --all-targets | ||
|
||
- name: Run tests | ||
run: cargo test --all-targets | ||
|
||
linting: | ||
needs: build | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download and configure dependencies | ||
id: configure | ||
shell: pwsh | ||
run: .github/scripts/setup.ps1 -Runner ${{ matrix.os }} | ||
|
||
- name: Update system path | ||
shell: pwsh | ||
run: | | ||
"${{ steps.configure.outputs.protoc_bin }}" | Out-File -FilePath $env:GITHUB_PATH -Append | ||
- name: Install tools | ||
run: | | ||
rustup component add clippy | ||
rustup component add rustfmt | ||
- name: Lint | ||
run: cargo clippy --all-features -- -D warnings | ||
|
||
- name: Format | ||
run: cargo fmt -- --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="clippy" type="CargoCommandRunConfiguration" factoryName="Cargo Command"> | ||
<option name="command" value="clippy --all-features -- -D warnings" /> | ||
<option name="workingDirectory" value="file://$PROJECT_DIR$" /> | ||
<envs /> | ||
<option name="emulateTerminal" value="true" /> | ||
<option name="channel" value="DEFAULT" /> | ||
<option name="requiredFeatures" value="true" /> | ||
<option name="allFeatures" value="false" /> | ||
<option name="withSudo" value="false" /> | ||
<option name="buildTarget" value="REMOTE" /> | ||
<option name="backtrace" value="SHORT" /> | ||
<option name="isRedirectInput" value="false" /> | ||
<option name="redirectInputPath" value="" /> | ||
<method v="2"> | ||
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" /> | ||
</method> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pub mod events { | ||
pub mod models { | ||
use uuid::Uuid; | ||
|
||
pub use events::Event; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.