Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronleopold committed Feb 18, 2024
2 parents 7024792 + d8e9e4c commit 1a5e0d4
Show file tree
Hide file tree
Showing 31 changed files with 577 additions and 164 deletions.
409 changes: 409 additions & 0 deletions .github/CHANGELOG.md

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions .github/actions/build-desktop/action.yml
Expand Up @@ -21,10 +21,7 @@ runs:
# fi

- name: Setup rust
uses: ./.github/actions/setup-cargo

- name: Generate Prisma client
uses: ./.github/actions/setup-prisma
uses: ./.github/actions/setup-rust

- name: Copy bundled web app
uses: actions/download-artifact@v3
Expand Down
5 changes: 1 addition & 4 deletions .github/actions/build-docker/action.yml
Expand Up @@ -37,10 +37,7 @@ runs:
shell: bash

- name: Setup rust
uses: ./.github/actions/setup-cargo

- name: Generate Prisma client
uses: ./.github/actions/setup-prisma
uses: ./.github/actions/setup-rust

# We only need QEMU when an arm* platform is targeted
- name: Check QEMU requirement
Expand Down
13 changes: 1 addition & 12 deletions .github/actions/build-server/action.yml
Expand Up @@ -12,19 +12,8 @@ runs:
- name: Checkout project
uses: actions/checkout@v3

# - name: Configure environment
# run: |
# if [[ ${{ inputs.platform }} == 'linux' || ${{ inputs.platform }} == 'windows' ]]; then
# echo "RUN_SETUP=false" >> $GITHUB_ENV
# else
# echo "RUN_SETUP=true" >> $GITHUB_ENV
# fi

- name: Setup rust
uses: ./.github/actions/setup-cargo

- name: Generate Prisma client
uses: ./.github/actions/setup-prisma
uses: ./.github/actions/setup-rust

- name: Copy bundled web app
uses: actions/download-artifact@v3
Expand Down
1 change: 0 additions & 1 deletion .github/actions/build-web/action.yml
Expand Up @@ -20,7 +20,6 @@ runs:
node-version: '20.0.0'
cache: 'yarn'


- name: Install yarn
shell: bash
run: npm install -g yarn
Expand Down
45 changes: 0 additions & 45 deletions .github/actions/setup-cargo/action.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/actions/setup-prisma/action.yaml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/actions/setup-rust/action.yml
@@ -0,0 +1,44 @@
name: 'Setup system dependencies'
description: 'Install system dependencies and setup cache'

runs:
using: 'composite'
steps:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.72.1
profile: minimal
override: true
components: rustfmt, clippy

- name: Configure environment
if: ${{ runner.name != 'oromei-ubuntu' && runner.os != 'Windows' }}
shell: bash
run: CHECK_NODE=0 CHECK_CARGO=0 DEV_SETUP=0 ./scripts/system-setup.sh

- name: Cache Rust Dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: stump-rust-cache

- name: Restore cached Prisma client
id: cache-prisma-restore
uses: actions/cache/restore@v3
with:
path: core/src/prisma.rs
key: ${{ runner.os }}-prisma-${{ hashFiles('**/schema.prisma') }}

- name: Generate Prisma client
if: ${{ steps.cache-prisma-restore.outputs.cache-hit != 'true' }}
shell: bash
run: cargo prisma generate --schema=./core/prisma/schema.prisma

- name: Save Prisma client
id: cache-prisma-save
if: ${{ steps.cache-prisma-restore.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v3
with:
path: core/src/prisma.rs
key: ${{ runner.os }}-prisma-${{ hashFiles('**/schema.prisma') }}
restore-keys: ${{ runner.os }}-prisma-${{ hashFiles('**/schema.prisma') }}
13 changes: 6 additions & 7 deletions .github/workflows/ci.yaml
Expand Up @@ -8,17 +8,15 @@ on:

jobs:
check-rust:
if: "!contains(github.event.pull_request.head.ref, 'release/v')"
name: Rust checks
runs-on: [self-hosted]
runs-on: [ubuntu-22.04]
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup cargo
uses: ./.github/actions/setup-cargo

- name: Setup prisma
uses: ./.github/actions/setup-prisma
- name: Setup rust
uses: ./.github/actions/setup-rust

- name: Run cargo checks
run: |
Expand All @@ -30,8 +28,9 @@ jobs:
# cargo integration-tests

check-typescript:
if: "!contains(github.event.pull_request.head.ref, 'release/v')"
name: TypeScript checks
runs-on: [self-hosted]
runs-on: [ubuntu-22.04]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nightly.yml
Expand Up @@ -18,8 +18,9 @@ env:

jobs:
nightly-docker-build:
if: "!contains(github.event.pull_request.head.ref, 'release/v')"
name: Build docker image
runs-on: [self-hosted]
runs-on: [ubuntu-22.04]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down
46 changes: 34 additions & 12 deletions .github/workflows/release.yml
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:
branches:
- main
types: [opened, closed]
types: [opened, closed, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -21,34 +21,56 @@ jobs:
parse-semver:
if: contains(github.event.pull_request.head.ref, 'release/v')
name: Parse semver version
runs-on: [self-hosted]
runs-on: [self-hosted, ubuntu-22.04]
outputs:
version: ${{ steps.tag.outputs.version }}
tags: ${{ steps.docker-tags.outputs.tags }}
steps:
- name: Extract version from branch name
id: tag
run: echo "version=$(echo ${{ github.event.pull_request.head.ref }} | sed -e 's/release\/v//')" >> $GITHUB_ENV
run: echo "version=$(echo ${{ github.event.pull_request.head.ref }} | sed -e 's/release\/v//')" >> $GITHUB_OUTPUT

- name: Print the tag
run: echo "The output version is ${{ steps.tag.outputs.version }}"

- name: Configure docker tags
id: docker-tags
run: |
echo "DOCKER_TAGS=latest,nightly,${{ steps.tag.outputs.version }}" >> $GITHUB_ENV
echo "tags=latest,nightly,${{ steps.tag.outputs.version }}" >> $GITHUB_OUTPUT
echo "Docker tags are latest, nightly, and ${{ steps.tag.outputs.version }}"
push-or-load:
if: contains(github.event.pull_request.head.ref, 'release/v')
name: Configure docker load/push
runs-on: [self-hosted]
runs-on: [self-hosted, ubuntu-22.04]
outputs:
load: ${{ steps.configure.outputs.load }}
push: ${{ steps.configure.outputs.push }}
platforms: ${{ steps.configure.outputs.platforms }}
steps:
- name: Configure environment
id: configure
run: |
echo "load=${{ github.event.pull_request.merged == false }}" >> $GITHUB_OUTPUT
echo "push=${{ github.event.pull_request.merged == true }}" >> $GITHUB_OUTPUT
if [[ ${{ github.event.pull_request.merged }} == true ]]; then
echo "push=true" >> $GITHUB_OUTPUT
echo "load=false" >> $GITHUB_OUTPUT
echo "platforms=linux/arm64/v8,linux/amd64" >> $GITHUB_OUTPUT
else
echo "push=false" >> $GITHUB_OUTPUT
echo "load=true" >> $GITHUB_OUTPUT
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
fi
- name: Print the configuration
run: |
echo "Platforms: ${{ steps.configure.outputs.platforms }}"
echo "Load: ${{ steps.configure.outputs.load }}"
echo "Push: ${{ steps.configure.outputs.push }}"
build-stable-docker:
if: contains(github.event.pull_request.head.ref, 'release/v')
name: Build docker image
runs-on: [self-hosted]
runs-on: [ubuntu-22.04]
needs: [parse-semver, push-or-load]
steps:
- name: Checkout repository
Expand All @@ -59,10 +81,10 @@ jobs:
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
tags: ${{ env.DOCKER_TAGS }}
load: ${{ steps.push-or-load.outputs.load }}
push: ${{ steps.push-or-load.outputs.push }}
platforms: 'linux/arm64/v8,linux/amd64'
tags: ${{ needs.parse-semver.outputs.tags }}
load: ${{ needs.push-or-load.outputs.load }}
push: ${{ needs.push-or-load.outputs.push }}
platforms: ${{ needs.push-or-load.outputs.platforms }}
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}

# build-web-app:
Expand Down
5 changes: 3 additions & 2 deletions .prettierignore
Expand Up @@ -9,5 +9,6 @@ dist
build
.next

# locale files
packages/browser/src/i18n/locales/*.json
packages/browser/src/i18n/locales/*.json

CHANGELOG.md

0 comments on commit 1a5e0d4

Please sign in to comment.