Skip to content

build: update Rust version to 1.90 #757

build: update Rust version to 1.90

build: update Rust version to 1.90 #757

Workflow file for this run

name: CI
on:
push:
branches:
- main
- "build/**"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
check:
name: Run checks
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Install SQLx CLI
run: |
mkdir -p ~/.local/bin
curl -L https://development-content.brioche.dev/tools/sqlx-cli_v0.7.1/sqlx -o ~/.local/bin/sqlx
curl -L https://development-content.brioche.dev/tools/sqlx-cli_v0.7.1/cargo-sqlx -o ~/.local/bin/cargo-sqlx
chmod +x ~/.local/bin/sqlx ~/.local/bin/cargo-sqlx
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Check formatting
run: cargo fmt -- --check
- name: Check database schema
run: make check-db-schema
- name: Check Clippy
run: cargo clippy --all -- -Dwarnings
- name: Install runtime distribution packages
run: |
cd crates/brioche-core/runtime
npm install
- name: Check runtime distribution types
run: |
cd crates/brioche-core/runtime
npm run check
- name: Check runtime distribution is up to date
run: |
cd crates/brioche-core/runtime
npm install
npm run build
if [ -n "$(git status --porcelain)" ]; then
git status
echo "NPM build in crates/brioche/runtime is out of date!" >&2
echo "Re-run 'npm run build' and commit the results" >&2
exit 1
fi
- name: Install Brioche
uses: brioche-dev/setup-brioche@v1
- name: Check Brioche project
# HACK: Added a workaround for bug fixed by https://github.com/brioche-dev/brioche/pull/216
# TODO: Update when Brioche >0.1.5 is released
run: |
brioche check || true
brioche check
brioche fmt --check
test:
name: Run tests [${{ matrix.test.name }}]
strategy:
matrix:
test:
- name: x86-64 Ubuntu 22.04
runs_on: ubuntu-22.04
- name: x86-64 Ubuntu 22.04 + PRoot
runs_on: ubuntu-22.04
setup: |
echo 'BRIOCHE_TEST_SANDBOX=linux_namespace' >> "$GITHUB_ENV"
echo 'BRIOCHE_TEST_SANDBOX_PROOT=true' >> "$GITHUB_ENV"
- name: x86-64 Ubuntu 24.04
runs_on: ubuntu-24.04
- name: x86-64 Ubuntu 24.04 + Namespaces
runs_on: ubuntu-24.04
setup: |
echo 'kernel.apparmor_restrict_unprivileged_userns = 0' | sudo tee /etc/sysctl.d/99-userns.conf
sudo sysctl --system
- name: aarch64 macOS 15
runs_on: macos-15
runs-on: ${{ matrix.test.runs_on }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up runner
if: matrix.test.setup
run: ${{ matrix.test.setup }}
# Run tests in release mode. Running tests in debug mode uses a lot
# more disk space, so much so that it can cause the run to fail
- name: Run tests
run: cargo test --all --release
# Extra job that succeeds when all test jobs succeed (useful for PR requirements)
all-tests-passed:
name: All tests passed
needs: [check, test]
runs-on: ubuntu-24.04
steps:
- run: ":"
build:
name: Build artifacts [${{ matrix.platform.name }}]
if: github.event_name == 'push'
strategy:
matrix:
platform:
- name: x86_64-linux
runs_on: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- name: aarch64-linux
runs_on: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
- name: x86_64-macos
runs_on: macos-15
target: x86_64-apple-darwin
- name: aarch64-macos
runs_on: macos-15
target: aarch64-apple-darwin
runs-on: ${{ matrix.platform.runs_on }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Install dependencies
if: matrix.platform.install_deps
run: ${{ matrix.platform.install_deps }}
- name: Install Rust targets
run: rustup target add "$TARGET"
env:
TARGET: ${{ matrix.platform.target }}
- name: Build Brioche
run: |
extra_args=()
if [ -n "$FEATURES" ]; then
extra_args+=(--features "$FEATURES")
fi
cargo build \
--all \
--bin brioche \
--release \
--target="$TARGET" \
"${extra_args[@]}"
env:
TARGET: ${{ matrix.platform.target }}
FEATURES: ${{ matrix.platform.features }}
- name: Prepare artifact
run: |
mkdir -p "artifacts/brioche/$PLATFORM/"
cp \
"target/$TARGET/release/brioche" \
"artifacts/brioche/$PLATFORM/"
if command -v sha256sum &> /dev/null; then
find artifacts/ -type f | xargs sha256sum
fi
if command -v tree &> /dev/null; then
tree --du -h artifacts/brioche
fi
env:
PLATFORM: ${{ matrix.platform.name }}
TARGET: ${{ matrix.platform.target }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: brioche-${{ matrix.platform.name }}
if-no-files-found: error
path: artifacts/brioche
build-packed:
name: Build packed artifacts
if: github.event_name == 'push'
strategy:
matrix:
platform:
- name: x86_64-linux
runs_on: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- name: aarch64-linux
runs_on: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
nightly: "true"
runs-on: ${{ matrix.platform.runs_on }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Install Brioche
if: matrix.platform.nightly != 'true'
uses: brioche-dev/setup-brioche@v1
- name: Install Brioche (nightly)
if: matrix.platform.nightly == 'true'
run: |
mkdir -p ~/.local/bin
curl -L https://development-content.brioche.dev/github.com/brioche-dev/brioche/branches/main/$PLATFORM/brioche -o ~/.local/bin/brioche
chmod +x ~/.local/bin/brioche
echo "$HOME/.local/bin" >> $GITHUB_PATH
env:
PLATFORM: ${{ matrix.platform.name }}
- name: Build Brioche
# HACK: Added a workaround for bug fixed by https://github.com/brioche-dev/brioche/pull/216
# TODO: Update when Brioche >0.1.5 is released
run: |
brioche check || true
brioche build --check -o "brioche-packed-$PLATFORM"
env:
PLATFORM: ${{ matrix.platform.name }}
- name: Prepare artifact
run: |
mkdir -p "artifacts/brioche-packed/$PLATFORM"
tar -czf "artifacts/brioche-packed/$PLATFORM/brioche-packed-$PLATFORM.tar.gz" "brioche-packed-$PLATFORM"
if command -v sha256sum &> /dev/null; then
find artifacts/ -type f | xargs sha256sum
fi
if command -v tree &> /dev/null; then
tree --du -h artifacts/brioche-packed
fi
env:
PLATFORM: ${{ matrix.platform.name }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: brioche-packed-${{ matrix.platform.name }}
if-no-files-found: error
path: artifacts/brioche-packed
push:
name: Push artifacts
if: github.event_name == 'push' && github.repository == 'brioche-dev/brioche'
needs: [check, all-tests-passed, build, build-packed]
runs-on: ubuntu-24.04
steps:
- name: Install AWS CLI
uses: unfor19/install-aws-cli-action@v1
- name: Download artifacts (x86_64-linux)
uses: actions/download-artifact@v5
with:
name: brioche-x86_64-linux
path: artifacts/brioche
- name: Download artifacts (aarch64-linux)
uses: actions/download-artifact@v5
with:
name: brioche-aarch64-linux
path: artifacts/brioche
- name: Download artifacts (x86_64-macos)
uses: actions/download-artifact@v5
with:
name: brioche-x86_64-macos
path: artifacts/brioche
- name: Download artifacts (aarch64-macos)
uses: actions/download-artifact@v5
with:
name: brioche-aarch64-macos
path: artifacts/brioche
- name: Download artifacts (x86_64-linux packed)
uses: actions/download-artifact@v5
with:
name: brioche-packed-x86_64-linux
path: artifacts/brioche-packed
- name: Download artifacts (aarch64-linux packed)
uses: actions/download-artifact@v5
with:
name: brioche-packed-aarch64-linux
path: artifacts/brioche-packed
# Upload the Brioche build for the current branch
- name: Prepare upload
run: |
mkdir -p artifacts/uploads/branch/brioche-packed
cp -r artifacts/brioche/* artifacts/uploads/branch/
cp -r artifacts/brioche-packed/* artifacts/uploads/branch/brioche-packed/
if command -v tree &> /dev/null; then
tree --du -h artifacts/uploads/branch
fi
- name: Upload to S3
run: |
aws s3 sync \
--endpoint "$S3_ENDPOINT" \
--delete \
artifacts/uploads/branch/ \
"s3://brioche-dev-development-content/github.com/brioche-dev/brioche/branches/$GITHUB_REF_NAME/"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_S3_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ vars.R2_S3_REGION }}
AWS_REQUEST_CHECKSUM_CALCULATION: WHEN_REQUIRED
AWS_RESPONSE_CHECKSUM_CALCULATION: WHEN_REQUIRED
S3_ENDPOINT: ${{ secrets.R2_S3_ENDPOINT }}