Skip to content

Commit

Permalink
ci: use self-hosted runners (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWhiteWu authored Jan 24, 2025
1 parent bcc2c6c commit 7d9814d
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 37 deletions.
64 changes: 33 additions & 31 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,23 @@ jobs:
runs-on: ubuntu-latest
needs:
- test-linux
# - test-linux-aarch64
- test-linux-aarch64
- test-macos
- test-windows
- lint
- docs-check
- test-cli
steps:
- run: exit 0

lint:
runs-on: [self-hosted, X64]
runs-on: [self-hosted, Linux, amd64]

strategy:
matrix:
rust: [nightly]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
components: rustfmt,clippy
Expand All @@ -42,13 +44,13 @@ jobs:
cargo fmt -- --check
docs-check:
runs-on: [self-hosted, X64]
runs-on: [self-hosted, Linux, amd64]

strategy:
matrix:
rust: [nightly]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
components: rustfmt,clippy
Expand All @@ -62,79 +64,79 @@ jobs:
cargo rustdoc -p volo-thrift --all-features -- --deny warnings
test-linux:
runs-on: [self-hosted, X64]
runs-on: [self-hosted, Linux, amd64]

strategy:
matrix:
rust: [nightly, stable]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
components: rustfmt,clippy
toolchain: ${{matrix.rust}}
- name: Run tests
run: |
bash scripts/install-linux-dependencies.sh
bash scripts/clippy-and-test.sh
# test-linux-aarch64:
# runs-on: [self-hosted, arm]

# strategy:
# matrix:
# rust: [nightly, stable]
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@master
# with:
# components: rustfmt,clippy
# toolchain: ${{matrix.rust}}
# - name: Run tests
# run: |
# bash scripts/clippy-and-test.sh
test-linux-aarch64:
runs-on: [self-hosted, Linux, aarch64]

strategy:
matrix:
rust: [nightly, stable]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
components: rustfmt,clippy
toolchain: ${{matrix.rust}}
- name: Run tests
run: |
bash scripts/install-linux-dependencies.sh
bash scripts/clippy-and-test.sh
test-macos:
runs-on: macos-latest
runs-on: [self-hosted, macOS]

strategy:
matrix:
rust: [nightly, stable]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
components: rustfmt,clippy
toolchain: ${{matrix.rust}}
# - uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
bash scripts/clippy-and-test.sh
test-windows:
runs-on: windows-latest
runs-on: [self-hosted, Windows]

strategy:
matrix:
rust: [nightly, stable]
rust: [stable]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
components: rustfmt,clippy
toolchain: ${{matrix.rust}}
# - uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
bash scripts/clippy-and-test.sh
test-cli:
runs-on: [self-hosted, X64]
runs-on: [self-hosted, Linux, amd64]

strategy:
matrix:
rust: [stable]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
components: rustfmt
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ permissions:

jobs:
dependency-review:
runs-on: [self-hosted, X64]
runs-on: [self-hosted, Linux, amd64]
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v1
5 changes: 3 additions & 2 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ on:
- '**/Cargo.lock'
jobs:
security-audit:
runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, amd64]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion scripts/clippy-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ echo_command cargo clippy -p volo -- --deny warnings
echo_command cargo clippy -p volo-build -- --deny warnings
echo_command cargo clippy -p volo-cli -- --deny warnings
echo_command cargo clippy -p volo-macros -- --deny warnings
echo_command cargo clippy -p examples -- --deny warnings
echo_command cargo clippy -p examples -- -A clippy::literal_string_with_formatting_args --deny warnings

# Test
echo_command cargo test -p volo-thrift
Expand Down
8 changes: 8 additions & 0 deletions scripts/install-linux-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail

apt update
apt install -y cmake libssl-dev pkg-config
2 changes: 1 addition & 1 deletion tests/code-generation/thrift/common.thrift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# for test dedups
namespace rs common
namespace rs common

struct CommonReq {
}

0 comments on commit 7d9814d

Please sign in to comment.