Skip to content

Commit

Permalink
Fix mobile CI + Some small CI improvements (#2113)
Browse files Browse the repository at this point in the history
Fix mobile CI
 - Use rust envvars in all workflows
 - Use rust envvars and mold when build sd-server docker
  • Loading branch information
HeavenVolkoff committed Feb 21, 2024
1 parent b638fc2 commit 3bdcc05
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-system/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ runs:
if: ${{ runner.os != 'Linux' }}
uses: ilammy/setup-nasm@v1

- name: Install Mold
- name: Install Mold (linker)
shell: bash
if: ${{ runner.os == 'Linux' }}
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cache-factory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ jobs:
remove-haskell: 'true'
remove-docker-images: 'true'

- name: Checkout repository
uses: actions/checkout@v4

- name: Symlink target to C:\
if: ${{ runner.os == 'Windows' }}
shell: powershell
run: |
New-Item -ItemType Directory -Force -Path C:\spacedrive_target
New-Item -Path target -ItemType Junction -Value C:\spacedrive_target
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup System and Rust
uses: ./.github/actions/setup-system
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:

env:
SPACEDRIVE_CUSTOM_APT_FLAGS: --no-install-recommends
# From: https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/ci.yaml
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
RUSTUP_MAX_RETRIES: 10

# Cancel previous runs of the same workflow on the same branch.
concurrency:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/mobile-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
env:
SPACEDRIVE_CUSTOM_APT_FLAGS: --no-install-recommends
SPACEDRIVE_CI: '1'
# From: https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/ci.yaml
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
RUSTUP_MAX_RETRIES: 10

# Cancel previous runs of the same workflow on the same branch.
concurrency:
Expand Down Expand Up @@ -199,7 +204,7 @@ jobs:
- name: Run Simulator
uses: futureware-tech/simulator-action@v2
with:
model: 'iPhone 11'
model: 'iPhone SE (3rd generation)'

- name: Run Tests
run: |
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ on:
workflow_dispatch:
# NOTE: For Linux builds, we can only build with Ubuntu. It should be the oldest base system we intend to support. See PR-759 & https://tauri.app/v1/guides/building/linux for reference.

# From: https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/release.yaml#L13-L21
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10

jobs:
desktop-main:
strategy:
Expand Down
11 changes: 10 additions & 1 deletion apps/server/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/
FROM base as build-base

RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \
apt-get install build-essential git sudo unzip wget
apt-get install build-essential git sudo unzip wget curl

RUN wget -qO- https://get.pnpm.io/install.sh | env SHELL=bash PNPM_HOME=/usr/share/pnpm sh -

Expand Down Expand Up @@ -60,6 +60,15 @@ RUN wget -qO- https://sh.rustup.rs | sh -s -- -yq --profile minimal

ENV PATH="/root/.cargo/bin:$PATH"

# From: https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/release.yaml#L13-L21
ENV CARGO_NET_RETRY=10
ENV CARGO_INCREMENTAL=0
ENV RUSTUP_MAX_RETRIES=10

# Install mold (linker)
RUN curl -L# 'https://github.com/rui314/mold/releases/download/v2.4.0/mold-2.4.0-x86_64-linux.tar.gz' \
| sudo tar -xzf- -C /usr/local

RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \
env CI=true ./scripts/setup.sh

Expand Down

0 comments on commit 3bdcc05

Please sign in to comment.