mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
ci: parallelize rust checks and guard prereleases
This commit is contained in:
21
.github/workflows/docker-publish.yml
vendored
21
.github/workflows/docker-publish.yml
vendored
@@ -212,6 +212,25 @@ jobs:
|
|||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Classify release tag
|
||||||
|
id: release_tag
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
tag="${GITHUB_REF_NAME}"
|
||||||
|
if [[ ! "${tag}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z][0-9A-Za-z.-]*)?$ ]]; then
|
||||||
|
echo "Unsupported release tag: ${tag}" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${tag}" == *-* ]]; then
|
||||||
|
echo "prerelease=true" >> "${GITHUB_OUTPUT}"
|
||||||
|
echo "make_latest=false" >> "${GITHUB_OUTPUT}"
|
||||||
|
else
|
||||||
|
echo "prerelease=false" >> "${GITHUB_OUTPUT}"
|
||||||
|
echo "make_latest=true" >> "${GITHUB_OUTPUT}"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Download release package artifact
|
- name: Download release package artifact
|
||||||
uses: actions/download-artifact@v5
|
uses: actions/download-artifact@v5
|
||||||
with:
|
with:
|
||||||
@@ -222,6 +241,8 @@ jobs:
|
|||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
|
prerelease: ${{ steps.release_tag.outputs.prerelease }}
|
||||||
|
make_latest: ${{ steps.release_tag.outputs.make_latest }}
|
||||||
files: |
|
files: |
|
||||||
release-assets/*.tar.gz
|
release-assets/*.tar.gz
|
||||||
release-assets/SHA256SUMS
|
release-assets/SHA256SUMS
|
||||||
|
|||||||
317
.github/workflows/rust-ci.yml
vendored
317
.github/workflows/rust-ci.yml
vendored
@@ -46,8 +46,8 @@ jobs:
|
|||||||
- name: Format
|
- name: Format
|
||||||
run: cargo fmt --all --check
|
run: cargo fmt --all --check
|
||||||
|
|
||||||
clippy:
|
clippy_gateway:
|
||||||
name: Clippy
|
name: Clippy (Gateway)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
@@ -74,7 +74,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
RUSTC_WRAPPER: sccache
|
RUSTC_WRAPPER: sccache
|
||||||
SCCACHE_GHA_ENABLED: "true"
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
run: cargo clippy --workspace --all-targets -- -D warnings
|
run: cargo clippy -p aether-gateway --all-targets -- -D warnings
|
||||||
|
|
||||||
- name: Show sccache stats
|
- name: Show sccache stats
|
||||||
if: always()
|
if: always()
|
||||||
@@ -83,8 +83,100 @@ jobs:
|
|||||||
SCCACHE_GHA_ENABLED: "true"
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
run: sccache --show-stats
|
run: sccache --show-stats
|
||||||
|
|
||||||
test:
|
clippy_data:
|
||||||
name: Test
|
name: Clippy (Data)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Show Rust toolchain
|
||||||
|
run: rustup show active-toolchain
|
||||||
|
|
||||||
|
- name: Install clippy component
|
||||||
|
run: rustup component add clippy
|
||||||
|
|
||||||
|
- name: Rust cache
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
shared-key: rust-ci-${{ runner.os }}
|
||||||
|
workspaces: . -> target
|
||||||
|
|
||||||
|
- name: Setup sccache
|
||||||
|
uses: mozilla-actions/sccache-action@v0.0.9
|
||||||
|
|
||||||
|
- name: Clippy
|
||||||
|
env:
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
run: cargo clippy -p aether-data --all-targets -- -D warnings
|
||||||
|
|
||||||
|
- name: Show sccache stats
|
||||||
|
if: always()
|
||||||
|
env:
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
run: sccache --show-stats
|
||||||
|
|
||||||
|
clippy_rest:
|
||||||
|
name: Clippy (Workspace Rest)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Show Rust toolchain
|
||||||
|
run: rustup show active-toolchain
|
||||||
|
|
||||||
|
- name: Install clippy component
|
||||||
|
run: rustup component add clippy
|
||||||
|
|
||||||
|
- name: Rust cache
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
shared-key: rust-ci-${{ runner.os }}
|
||||||
|
workspaces: . -> target
|
||||||
|
|
||||||
|
- name: Setup sccache
|
||||||
|
uses: mozilla-actions/sccache-action@v0.0.9
|
||||||
|
|
||||||
|
- name: Clippy
|
||||||
|
env:
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
run: cargo clippy --workspace --exclude aether-gateway --exclude aether-data --all-targets -- -D warnings
|
||||||
|
|
||||||
|
- name: Show sccache stats
|
||||||
|
if: always()
|
||||||
|
env:
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
run: sccache --show-stats
|
||||||
|
|
||||||
|
clippy:
|
||||||
|
name: Clippy
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- clippy_gateway
|
||||||
|
- clippy_data
|
||||||
|
- clippy_rest
|
||||||
|
if: ${{ always() }}
|
||||||
|
steps:
|
||||||
|
- name: Verify clippy jobs
|
||||||
|
run: |
|
||||||
|
if [ "${{ needs.clippy_gateway.result }}" != "success" ] || \
|
||||||
|
[ "${{ needs.clippy_data.result }}" != "success" ] || \
|
||||||
|
[ "${{ needs.clippy_rest.result }}" != "success" ]; then
|
||||||
|
echo "Clippy failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
test_gateway:
|
||||||
|
name: Test (Gateway)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
@@ -108,7 +200,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
RUSTC_WRAPPER: sccache
|
RUSTC_WRAPPER: sccache
|
||||||
SCCACHE_GHA_ENABLED: "true"
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
run: cargo test --workspace
|
run: cargo test -p aether-gateway
|
||||||
|
|
||||||
- name: Show sccache stats
|
- name: Show sccache stats
|
||||||
if: always()
|
if: always()
|
||||||
@@ -117,8 +209,128 @@ jobs:
|
|||||||
SCCACHE_GHA_ENABLED: "true"
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
run: sccache --show-stats
|
run: sccache --show-stats
|
||||||
|
|
||||||
data_db_smoke:
|
test_data:
|
||||||
name: Data DB Smoke
|
name: Test (Data)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Show Rust toolchain
|
||||||
|
run: rustup show active-toolchain
|
||||||
|
|
||||||
|
- name: Rust cache
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
shared-key: rust-ci-${{ runner.os }}
|
||||||
|
workspaces: . -> target
|
||||||
|
|
||||||
|
- name: Setup sccache
|
||||||
|
uses: mozilla-actions/sccache-action@v0.0.9
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
env:
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
run: cargo test -p aether-data
|
||||||
|
|
||||||
|
- name: Show sccache stats
|
||||||
|
if: always()
|
||||||
|
env:
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
run: sccache --show-stats
|
||||||
|
|
||||||
|
test_rest:
|
||||||
|
name: Test (Workspace Rest)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Show Rust toolchain
|
||||||
|
run: rustup show active-toolchain
|
||||||
|
|
||||||
|
- name: Rust cache
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
shared-key: rust-ci-${{ runner.os }}
|
||||||
|
workspaces: . -> target
|
||||||
|
|
||||||
|
- name: Setup sccache
|
||||||
|
uses: mozilla-actions/sccache-action@v0.0.9
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
env:
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
run: cargo test --workspace --exclude aether-gateway --exclude aether-data
|
||||||
|
|
||||||
|
- name: Show sccache stats
|
||||||
|
if: always()
|
||||||
|
env:
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
run: sccache --show-stats
|
||||||
|
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- test_gateway
|
||||||
|
- test_data
|
||||||
|
- test_rest
|
||||||
|
if: ${{ always() }}
|
||||||
|
steps:
|
||||||
|
- name: Verify test jobs
|
||||||
|
run: |
|
||||||
|
if [ "${{ needs.test_gateway.result }}" != "success" ] || \
|
||||||
|
[ "${{ needs.test_data.result }}" != "success" ] || \
|
||||||
|
[ "${{ needs.test_rest.result }}" != "success" ]; then
|
||||||
|
echo "Tests failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
data_db_smoke_sqlite:
|
||||||
|
name: Data DB Smoke (SQLite)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Show Rust toolchain
|
||||||
|
run: rustup show active-toolchain
|
||||||
|
|
||||||
|
- name: Rust cache
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
shared-key: rust-ci-${{ runner.os }}
|
||||||
|
workspaces: . -> target
|
||||||
|
|
||||||
|
- name: Setup sccache
|
||||||
|
uses: mozilla-actions/sccache-action@v0.0.9
|
||||||
|
|
||||||
|
- name: Run SQLite data smoke tests
|
||||||
|
env:
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
run: cargo test -p aether-data sqlite --lib
|
||||||
|
|
||||||
|
- name: Show sccache stats
|
||||||
|
if: always()
|
||||||
|
env:
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
run: sccache --show-stats
|
||||||
|
|
||||||
|
data_db_smoke_postgres:
|
||||||
|
name: Data DB Smoke (Postgres)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
@@ -134,6 +346,56 @@ jobs:
|
|||||||
--health-interval=5s
|
--health-interval=5s
|
||||||
--health-timeout=5s
|
--health-timeout=5s
|
||||||
--health-retries=20
|
--health-retries=20
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Show Rust toolchain
|
||||||
|
run: rustup show active-toolchain
|
||||||
|
|
||||||
|
- name: Rust cache
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
shared-key: rust-ci-${{ runner.os }}
|
||||||
|
workspaces: . -> target
|
||||||
|
|
||||||
|
- name: Setup sccache
|
||||||
|
uses: mozilla-actions/sccache-action@v0.0.9
|
||||||
|
|
||||||
|
- name: Run Postgres migration smoke test
|
||||||
|
env:
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
AETHER_TEST_POSTGRES_URL: postgres://aether:aether@127.0.0.1:5432/aether_test
|
||||||
|
run: cargo test -p aether-data postgres_migrations_create_core_config_tables_when_url_is_set --lib -- --nocapture
|
||||||
|
|
||||||
|
- name: Run Postgres core export smoke test
|
||||||
|
env:
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
AETHER_TEST_POSTGRES_URL: postgres://aether:aether@127.0.0.1:5432/aether_test
|
||||||
|
run: cargo test -p aether-data postgres_core_export_reads_migrated_database_rows_when_url_is_set --lib -- --nocapture
|
||||||
|
|
||||||
|
- name: Run SQLite-to-Postgres import smoke test
|
||||||
|
env:
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
AETHER_TEST_POSTGRES_URL: postgres://aether:aether@127.0.0.1:5432/aether_test
|
||||||
|
run: cargo test -p aether-data sqlite_core_export_reads_migrated_database_rows --lib -- --nocapture
|
||||||
|
|
||||||
|
- name: Show sccache stats
|
||||||
|
if: always()
|
||||||
|
env:
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
run: sccache --show-stats
|
||||||
|
|
||||||
|
data_db_smoke_mysql:
|
||||||
|
name: Data DB Smoke (MySQL)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
mysql:
|
mysql:
|
||||||
image: mysql:8.0
|
image: mysql:8.0
|
||||||
env:
|
env:
|
||||||
@@ -166,27 +428,6 @@ jobs:
|
|||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
uses: mozilla-actions/sccache-action@v0.0.9
|
uses: mozilla-actions/sccache-action@v0.0.9
|
||||||
|
|
||||||
- name: Run SQLite data smoke tests
|
|
||||||
env:
|
|
||||||
RUSTC_WRAPPER: sccache
|
|
||||||
SCCACHE_GHA_ENABLED: "true"
|
|
||||||
AETHER_TEST_POSTGRES_URL: postgres://aether:aether@127.0.0.1:5432/aether_test
|
|
||||||
run: cargo test -p aether-data sqlite --lib
|
|
||||||
|
|
||||||
- name: Run Postgres migration smoke test
|
|
||||||
env:
|
|
||||||
RUSTC_WRAPPER: sccache
|
|
||||||
SCCACHE_GHA_ENABLED: "true"
|
|
||||||
AETHER_TEST_POSTGRES_URL: postgres://aether:aether@127.0.0.1:5432/aether_test
|
|
||||||
run: cargo test -p aether-data postgres_migrations_create_core_config_tables_when_url_is_set --lib -- --nocapture
|
|
||||||
|
|
||||||
- name: Run Postgres core export smoke test
|
|
||||||
env:
|
|
||||||
RUSTC_WRAPPER: sccache
|
|
||||||
SCCACHE_GHA_ENABLED: "true"
|
|
||||||
AETHER_TEST_POSTGRES_URL: postgres://aether:aether@127.0.0.1:5432/aether_test
|
|
||||||
run: cargo test -p aether-data postgres_core_export_reads_migrated_database_rows_when_url_is_set --lib -- --nocapture
|
|
||||||
|
|
||||||
- name: Run MySQL migration smoke test
|
- name: Run MySQL migration smoke test
|
||||||
env:
|
env:
|
||||||
RUSTC_WRAPPER: sccache
|
RUSTC_WRAPPER: sccache
|
||||||
@@ -250,6 +491,24 @@ jobs:
|
|||||||
SCCACHE_GHA_ENABLED: "true"
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
run: sccache --show-stats
|
run: sccache --show-stats
|
||||||
|
|
||||||
|
data_db_smoke:
|
||||||
|
name: Data DB Smoke
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- data_db_smoke_sqlite
|
||||||
|
- data_db_smoke_postgres
|
||||||
|
- data_db_smoke_mysql
|
||||||
|
if: ${{ always() }}
|
||||||
|
steps:
|
||||||
|
- name: Verify database smoke jobs
|
||||||
|
run: |
|
||||||
|
if [ "${{ needs.data_db_smoke_sqlite.result }}" != "success" ] || \
|
||||||
|
[ "${{ needs.data_db_smoke_postgres.result }}" != "success" ] || \
|
||||||
|
[ "${{ needs.data_db_smoke_mysql.result }}" != "success" ]; then
|
||||||
|
echo "Data DB smoke failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
check:
|
check:
|
||||||
name: check
|
name: check
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
Reference in New Issue
Block a user