Skip to content

Commit

Permalink
feat: added setup and ci workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
francis2tm committed Feb 8, 2024
1 parent 2c74a2d commit ffd7472
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 35 deletions.
39 changes: 4 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,11 @@ jobs:
- name: "Setup actions/checkout"
uses: actions/checkout@v4

# setup ubuntu dependencies
- name: Setup Ubuntu dependencies
if: matrix.runner == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y build-essential curl wget file libssl-dev libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev patchelf
# install llvm (for llvm-copy) on macos only. For cpp runtimes.
- name: "Setup MacOS dependencies"
if: matrix.runner == 'macos-latest'
run: |
brew update
brew install llvm@17
echo "$(brew --prefix llvm@17)/bin" >> $GITHUB_PATH
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: "Setup rust"
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Add rust target (macOS)
if: ${{ matrix.runner == 'macos-latest' }}
run: rustup target add aarch64-apple-darwin

- name: Add rust target (Other)
if: ${{ matrix.runner != 'macos-latest' }}
run: rustup target add ${{ matrix.target }}

- name: Install pnpm
uses: pnpm/action-setup@v2
- name: "Setup environment"
uses: ./.github/workflows/setup.yml
with:
version: 8
run_install: false
runner: ${{ matrix.runner }}
target: ${{ matrix.target }}

- name: Install GUI frontend dependencies
run: cd edgen && pnpm install # change this to npm or pnpm depending on which one you use
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "CI"
on:
push:
pull_request:

jobs:
formatting:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Setup environment"
uses: ./.github/workflows/setup.yml
with:
runner: ubuntu-20.04
target: x86_64-unknown-linux-gnu

- name: Rustfmt Check
uses: actions-rust-lang/rustfmt@v1
54 changes: 54 additions & 0 deletions .github/workflows/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "setup"

on:
workflow_call:
inputs:
runner:
required: true
type: string
target:
required: true
type: string

jobs:
triage:
runs-on: inputs.runner
steps:
# setup ubuntu dependencies
- name: Setup Ubuntu dependencies
if: inputs.runner == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y build-essential curl wget file libssl-dev libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev patchelf
# install llvm (for llvm-copy) on macos only. For cpp runtimes.
- name: "Setup MacOS dependencies"
if: inputs.runner == 'macos-latest'
run: |
brew update
brew install llvm@17
echo "$(brew --prefix llvm@17)/bin" >> $GITHUB_PATH
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: "Setup rust"
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt

- name: Add rust target (macOS)
if: inputs.runner == 'macos-latest'
run: rustup target add aarch64-apple-darwin

- name: Add rust target (Other)
if: inputs.runner != 'macos-latest'
run: rustup target add ${{ inputs.target }}

0 comments on commit ffd7472

Please sign in to comment.