Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 Adjust CI workflows #275

Merged
merged 9 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/actions/build-desktop/action.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
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
Original file line number Diff line number Diff line change
@@ -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') }}
11 changes: 4 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ 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 @@ -33,7 +30,7 @@ jobs:
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
Original file line number Diff line number Diff line change
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
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ 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 }}
Expand All @@ -42,7 +42,7 @@ jobs:
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 }}
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
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 Down
23 changes: 20 additions & 3 deletions scripts/system-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,34 @@ fi

CALL_TO_ACTION_LOL="Please consider helping to expand support for your system: https://github.com/stumpapp/stump/issues"

# TODO: group these? so lines aren't so long...
# https://tauri.app/v1/guides/getting-started/prerequisites/#1-system-dependencies
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
UNSUPPORTED_DISTRO="Your distro '$(lsb_release -s -d)' is not supported by this script. $CALL_TO_ACTION_LOL"

if which apt-get &> /dev/null; then
sudo apt-get -y update
sudo apt-get -y install pkg-config javascriptcoregtk-4.0 libssl-dev libdbus-1-dev libsoup2.4-dev libwebkit2gtk-4.0-dev curl wget libgtk-3-dev libappindicator3-dev librsvg2-dev build-essential libayatana-appindicator3-dev gobject-2.0 libcairo2-dev libatk1.0-dev libgdk-pixbuf2.0-dev
sudo apt-get -y install libwebkit2gtk-4.0-dev \
pkg-config \
build-essential \
curl \
wget \
file \
openssl \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libvips42
elif which pacman &> /dev/null; then
sudo pacman -Syu
sudo pacman -S --needed webkit2gtk base-devel curl wget openssl appmenu-gtk-module gtk3 libappindicator-gtk3 librsvg libvips
sudo pacman -S --needed webkit2gtk \
base-devel \
curl \
wget \
openssl \
appmenu-gtk-module \
gtk3 \
libappindicator-gtk3 librsvg libvips
elif which dnf &> /dev/null; then
sudo dnf check-update
sudo dnf install openssl-devel webkit2gtk4.0-devel curl wget libappindicator-gtk3 librsvg2-devel
Expand Down
Loading