-
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
selectdev
committed
Mar 16, 2024
0 parents
commit ee29d59
Showing
43 changed files
with
6,549 additions
and
0 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,6 @@ | ||
[unstable] | ||
build-std = ["std", "panic_abort"] | ||
#build-std-features = ["panic_immediate_abort"] | ||
|
||
[target.x86_64-unknown-linux-gnu] | ||
rustflags = ["-Z", "mir-opt-level=3", "-C", "target-cpu=native"] |
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,44 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "cargo-common", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(warning|warn|error)(\\[(\\S*)\\])?: (.*)$", | ||
"severity": 1, | ||
"message": 4, | ||
"code": 3 | ||
}, | ||
{ | ||
"regexp": "^\\s+-->\\s(\\S+):(\\d+):(\\d+)$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3 | ||
} | ||
] | ||
}, | ||
{ | ||
"owner": "cargo-test", | ||
"pattern": [ | ||
{ | ||
"regexp": "^.*panicked\\s+at\\s+'(.*)',\\s+(.*):(\\d+):(\\d+)$", | ||
"message": 1, | ||
"file": 2, | ||
"line": 3, | ||
"column": 4 | ||
} | ||
] | ||
}, | ||
{ | ||
"owner": "cargo-fmt", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(Diff in (\\S+)) at line (\\d+):", | ||
"message": 1, | ||
"file": 2, | ||
"line": 3 | ||
} | ||
] | ||
} | ||
] | ||
} |
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,47 @@ | ||
name: Check build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install nightly toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly | ||
components: clippy, rust-src | ||
|
||
- name: Cache dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Add problem matchers | ||
run: echo "::add-matcher::.github/rust.json" | ||
|
||
- name: Run clippy | ||
run: cargo clippy --target=x86_64-unknown-linux-gnu | ||
|
||
rustfmt: | ||
name: Formatting | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install nightly toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly | ||
components: rustfmt | ||
|
||
- name: Add problem matchers | ||
run: echo "::add-matcher::.github/rust.json" | ||
|
||
- name: Run cargo fmt | ||
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,50 @@ | ||
name: Build Docker Images | ||
on: [push] | ||
|
||
jobs: | ||
build-docker-image: | ||
strategy: | ||
matrix: | ||
target-cpu: ["znver3", "znver2", "skylake", "haswell", "sandybridge", "x86-64"] | ||
|
||
name: Build for ${{ matrix.target-cpu }} | ||
env: | ||
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKER_TARGET_ACCOUNT: ${{ secrets.DOCKERHUB_TARGET }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
if: env.DOCKER_USERNAME | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Login to ghcr | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Convert GITHUB_REPOSITORY into lowercase | ||
run: | | ||
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | ||
- name: Build Docker Image | ||
run: | | ||
docker build -t gateway-proxy:${{ matrix.target-cpu }} --build-arg TARGET_CPU=${{ matrix.target-cpu }} . | ||
- name: Create manifest and push it | ||
if: env.DOCKER_USERNAME && github.ref == 'refs/heads/main' | ||
run: | | ||
docker tag gateway-proxy:${{ matrix.target-cpu }} ${{ secrets.DOCKERHUB_TARGET }}/gateway-proxy:${{ matrix.target-cpu }} | ||
docker push ${{ secrets.DOCKERHUB_TARGET }}/gateway-proxy:${{ matrix.target-cpu }} | ||
docker tag gateway-proxy:${{ matrix.target-cpu }} ghcr.io/${REPO}:${{ matrix.target-cpu }} | ||
docker push ghcr.io/${REPO}:${{ matrix.target-cpu }} |
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,3 @@ | ||
target | ||
config.json | ||
gateway-proxy |
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,4 @@ | ||
[submodule "twilight"] | ||
path = twilight | ||
url = https://github.com/anti-raid/twilight-for-gateway-proxy | ||
branch = 15-custom |
Oops, something went wrong.