From ffd747227086e50060912c8e7d36755b3fad7864 Mon Sep 17 00:00:00 2001 From: francis2tm Date: Thu, 8 Feb 2024 17:59:19 +0000 Subject: [PATCH 01/14] feat: added setup and ci workflows --- .github/workflows/build.yml | 39 +++------------------------ .github/workflows/ci.yml | 19 +++++++++++++ .github/workflows/setup.yml | 54 +++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/setup.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c96b9e..d2f8b06 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4ce8a99 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml new file mode 100644 index 0000000..3ca5b28 --- /dev/null +++ b/.github/workflows/setup.yml @@ -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 }} From fbd198da9a2745887a0aacfee35d17731ae73c6d Mon Sep 17 00:00:00 2001 From: francis2tm Date: Thu, 8 Feb 2024 18:07:27 +0000 Subject: [PATCH 02/14] fix: added checkout workflow to setup.yml --- .github/workflows/setup.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml index 3ca5b28..71861e6 100644 --- a/.github/workflows/setup.yml +++ b/.github/workflows/setup.yml @@ -14,6 +14,8 @@ jobs: triage: runs-on: inputs.runner steps: + - name: "Setup actions/checkout" + uses: actions/checkout@v4 # setup ubuntu dependencies - name: Setup Ubuntu dependencies if: inputs.runner == 'ubuntu-20.04' From 50a7bc3bd663461695d7db1b6ec48a50d3e67442 Mon Sep 17 00:00:00 2001 From: francis2tm Date: Thu, 8 Feb 2024 18:10:28 +0000 Subject: [PATCH 03/14] chore: renamed workflows' names --- .github/workflows/ci.yml | 4 ++-- .github/workflows/setup.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ce8a99..423fa72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,8 +4,8 @@ on: pull_request: jobs: - formatting: - name: cargo fmt + ci: + name: CI runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml index 71861e6..d365a45 100644 --- a/.github/workflows/setup.yml +++ b/.github/workflows/setup.yml @@ -11,7 +11,7 @@ on: type: string jobs: - triage: + setup: runs-on: inputs.runner steps: - name: "Setup actions/checkout" From 0e2e3898bb3c872cb488d4653e34c6fad0261844 Mon Sep 17 00:00:00 2001 From: francis2tm Date: Thu, 8 Feb 2024 18:36:52 +0000 Subject: [PATCH 04/14] chore: turned setup into a reusable action --- .github/workflows/ci.yml | 2 +- .github/workflows/setup-action/action.yml | 56 +++++++++++++++++++++++ .github/workflows/setup.yml | 56 ----------------------- 3 files changed, 57 insertions(+), 57 deletions(-) create mode 100644 .github/workflows/setup-action/action.yml delete mode 100644 .github/workflows/setup.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 423fa72..59dee1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: "Setup environment" - uses: ./.github/workflows/setup.yml + uses: ./.github/workflows/setup-action with: runner: ubuntu-20.04 target: x86_64-unknown-linux-gnu diff --git a/.github/workflows/setup-action/action.yml b/.github/workflows/setup-action/action.yml new file mode 100644 index 0000000..f011ab2 --- /dev/null +++ b/.github/workflows/setup-action/action.yml @@ -0,0 +1,56 @@ +name: "Setup" +description: "Setup environment" +inputs: + runner: + description: "The runner for the setup" + required: true + type: string + target: + description: "The target for Rust" + required: true + type: string + +runs: + using: "composite" + steps: + - name: "Setup actions/checkout" + uses: actions/checkout@v4 + + # 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 }} diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml deleted file mode 100644 index d365a45..0000000 --- a/.github/workflows/setup.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: "setup" - -on: - workflow_call: - inputs: - runner: - required: true - type: string - target: - required: true - type: string - -jobs: - setup: - runs-on: inputs.runner - steps: - - name: "Setup actions/checkout" - uses: actions/checkout@v4 - # 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 }} From eb151319ebaa21bbb0f4e339204647e4533b10cc Mon Sep 17 00:00:00 2001 From: francis2tm Date: Thu, 8 Feb 2024 18:40:46 +0000 Subject: [PATCH 05/14] chore: Add shell attribute to runs step in action.yml --- .github/workflows/setup-action/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/setup-action/action.yml b/.github/workflows/setup-action/action.yml index f011ab2..8a19f7b 100644 --- a/.github/workflows/setup-action/action.yml +++ b/.github/workflows/setup-action/action.yml @@ -12,6 +12,7 @@ inputs: runs: using: "composite" + shell: bash steps: - name: "Setup actions/checkout" uses: actions/checkout@v4 From 8c411e6ab20fc00ca0e4231ac10e0019cc79a82c Mon Sep 17 00:00:00 2001 From: francis2tm Date: Thu, 8 Feb 2024 18:49:18 +0000 Subject: [PATCH 06/14] chore: Add shell attribute to runs step in action.yml --- .github/workflows/setup-action/action.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/setup-action/action.yml b/.github/workflows/setup-action/action.yml index 8a19f7b..195d6a6 100644 --- a/.github/workflows/setup-action/action.yml +++ b/.github/workflows/setup-action/action.yml @@ -1,5 +1,5 @@ name: "Setup" -description: "Setup environment" +description: "Setup environment for CI" inputs: runner: description: "The runner for the setup" @@ -12,17 +12,14 @@ inputs: runs: using: "composite" - shell: bash steps: - - name: "Setup actions/checkout" - uses: actions/checkout@v4 - # setup ubuntu dependencies - - name: 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 + shell: bash # install llvm (for llvm-copy) on macos only. For cpp runtimes. - name: "Setup MacOS dependencies" @@ -30,14 +27,15 @@ runs: run: | brew update brew install llvm@17 - echo "$(brew --prefix llvm@17)/bin" >> $GITHUB_PATH + echo "$$(brew --prefix llvm@17)/bin" >> $GITHUB_PATH + shell: bash - - name: Install Node.js + - name: "Install Node.js" uses: actions/setup-node@v3 with: node-version: 18 - - name: Install pnpm + - name: "Install pnpm" uses: pnpm/action-setup@v2 with: version: 8 @@ -48,10 +46,12 @@ runs: with: components: rustfmt - - name: Add rust target (macOS) + - name: "Add rust target (macOS)" if: inputs.runner == 'macos-latest' run: rustup target add aarch64-apple-darwin + shell: bash - - name: Add rust target (Other) + - name: "Add rust target (Other)" if: inputs.runner != 'macos-latest' run: rustup target add ${{ inputs.target }} + shell: bash From 669019cdf58372fcb2cd2974ca203d3396476cc5 Mon Sep 17 00:00:00 2001 From: francis2tm Date: Thu, 8 Feb 2024 18:51:51 +0000 Subject: [PATCH 07/14] chore: update workflow setup names --- .github/workflows/build.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d2f8b06..20127f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: - name: "Setup actions/checkout" uses: actions/checkout@v4 - - name: "Setup environment" + - name: "Setup-action" uses: ./.github/workflows/setup.yml with: runner: ${{ matrix.runner }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59dee1f..0dc5c7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: "Setup environment" + - name: "Setup-action" uses: ./.github/workflows/setup-action with: runner: ubuntu-20.04 From 7749e5d56c7d3d3166e50f45a3ca67dcad454831 Mon Sep 17 00:00:00 2001 From: francis2tm Date: Thu, 8 Feb 2024 18:54:58 +0000 Subject: [PATCH 08/14] Update workflow setup-action in build.yml and ci.yml --- .github/workflows/build.yml | 2 +- .github/workflows/ci.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 20127f7..8465ec9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ jobs: uses: actions/checkout@v4 - name: "Setup-action" - uses: ./.github/workflows/setup.yml + uses: ./.github/workflows/setup-action with: runner: ${{ matrix.runner }} target: ${{ matrix.target }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0dc5c7a..e96e6e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,9 @@ jobs: name: CI runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: "Setup actions/checkout" + uses: actions/checkout@v4 + - name: "Setup-action" uses: ./.github/workflows/setup-action with: From a23a05ff70978a5bd49100df74efefbb5f40299b Mon Sep 17 00:00:00 2001 From: francis2tm Date: Fri, 9 Feb 2024 11:09:37 +0000 Subject: [PATCH 09/14] chore: explicitly install binutils in macos runner --- .github/workflows/ci.yml | 4 +++- .github/workflows/setup-action/action.yml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e96e6e7..3603694 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: "CI" on: push: + branches: ["main"] pull_request: + branches: ["main"] jobs: ci: name: CI - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: "Setup actions/checkout" uses: actions/checkout@v4 diff --git a/.github/workflows/setup-action/action.yml b/.github/workflows/setup-action/action.yml index 195d6a6..1b13f02 100644 --- a/.github/workflows/setup-action/action.yml +++ b/.github/workflows/setup-action/action.yml @@ -26,6 +26,7 @@ runs: if: inputs.runner == 'macos-latest' run: | brew update + brew install binutils brew install llvm@17 echo "$$(brew --prefix llvm@17)/bin" >> $GITHUB_PATH shell: bash From 12b7caad318f33af0052fca6b9aa9511cfe8c452 Mon Sep 17 00:00:00 2001 From: francis2tm Date: Fri, 9 Feb 2024 13:10:03 +0000 Subject: [PATCH 10/14] Add binutils and llvm@17 to GitHub PATH --- .github/workflows/setup-action/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/setup-action/action.yml b/.github/workflows/setup-action/action.yml index 1b13f02..bfc7b2f 100644 --- a/.github/workflows/setup-action/action.yml +++ b/.github/workflows/setup-action/action.yml @@ -27,6 +27,7 @@ runs: run: | brew update brew install binutils + echo "$$(brew --prefix binutils)/bin" >> $GITHUB_PATH brew install llvm@17 echo "$$(brew --prefix llvm@17)/bin" >> $GITHUB_PATH shell: bash From 1b24247104909ee8464fa31074b6a4a4de7b15b4 Mon Sep 17 00:00:00 2001 From: francis2tm Date: Fri, 9 Feb 2024 13:50:13 +0000 Subject: [PATCH 11/14] chore: exporting brew installed PATHs --- .github/workflows/setup-action/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/setup-action/action.yml b/.github/workflows/setup-action/action.yml index bfc7b2f..4166b6b 100644 --- a/.github/workflows/setup-action/action.yml +++ b/.github/workflows/setup-action/action.yml @@ -27,9 +27,9 @@ runs: run: | brew update brew install binutils - echo "$$(brew --prefix binutils)/bin" >> $GITHUB_PATH + export GITHUB_PATH="$$(brew --prefix binutils)/bin:$GITHUB_PATH" brew install llvm@17 - echo "$$(brew --prefix llvm@17)/bin" >> $GITHUB_PATH + export GITHUB_PATH="$$(brew --prefix llvm@17)/bin:$GITHUB_PATH" shell: bash - name: "Install Node.js" From 3dd566f2ed769f95b5e50b08a001cf5397f1e00f Mon Sep 17 00:00:00 2001 From: francis2tm Date: Fri, 9 Feb 2024 14:16:31 +0000 Subject: [PATCH 12/14] try llvm install action --- .github/workflows/setup-action/action.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/setup-action/action.yml b/.github/workflows/setup-action/action.yml index 4166b6b..d14d3e6 100644 --- a/.github/workflows/setup-action/action.yml +++ b/.github/workflows/setup-action/action.yml @@ -22,15 +22,18 @@ runs: shell: bash # 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 binutils - export GITHUB_PATH="$$(brew --prefix binutils)/bin:$GITHUB_PATH" - brew install llvm@17 - export GITHUB_PATH="$$(brew --prefix llvm@17)/bin:$GITHUB_PATH" - shell: bash + # - name: "Setup MacOS dependencies" + # if: inputs.runner == 'macos-latest' + # run: | + # brew update + # brew install llvm@17 + # echo "$$(brew --prefix llvm@17)/bin" >> $GITHUB_PATH + # shell: bash + + - name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v1 + with: + version: "17.0" - name: "Install Node.js" uses: actions/setup-node@v3 From cad2d2feae577592feb05fb42c52cc338cb46ab6 Mon Sep 17 00:00:00 2001 From: francis2tm Date: Fri, 9 Feb 2024 14:41:35 +0000 Subject: [PATCH 13/14] chore: give up on reusable workflows --- .github/workflows/build.yml | 37 +++++-- .github/workflows/ci.yml | 27 ++++- .github/workflows/setup-action/action.yml | 119 +++++++++++----------- 3 files changed, 111 insertions(+), 72 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8465ec9..4e7a59f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,14 +31,39 @@ jobs: name: ${{ matrix.name }} runs-on: ${{ matrix.runner }} steps: - - 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 - - name: "Setup-action" - uses: ./.github/workflows/setup-action + # 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: "Install pnpm" + uses: pnpm/action-setup@v2 with: - runner: ${{ matrix.runner }} - target: ${{ matrix.target }} + version: 8 + run_install: false + + - name: "Setup rust" + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt + + - name: "Add rust target" + run: rustup target add ${{ matrix.target }} - name: Install GUI frontend dependencies run: cd edgen && pnpm install # change this to npm or pnpm depending on which one you use diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3603694..0cdf9ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,11 +13,30 @@ jobs: - name: "Setup actions/checkout" uses: actions/checkout@v4 - - name: "Setup-action" - uses: ./.github/workflows/setup-action + # setup ubuntu dependencies + - name: "Setup Ubuntu dependencies" + 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 + + - name: "Install Node.js" + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: "Install pnpm" + uses: pnpm/action-setup@v2 with: - runner: ubuntu-20.04 - target: x86_64-unknown-linux-gnu + version: 8 + run_install: false + + - name: "Setup rust" + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt + + - name: "Add rust target" + run: rustup target add x86_64-unknown-linux-gnu - name: Rustfmt Check uses: actions-rust-lang/rustfmt@v1 diff --git a/.github/workflows/setup-action/action.yml b/.github/workflows/setup-action/action.yml index d14d3e6..f004bbf 100644 --- a/.github/workflows/setup-action/action.yml +++ b/.github/workflows/setup-action/action.yml @@ -1,62 +1,57 @@ -name: "Setup" -description: "Setup environment for CI" -inputs: - runner: - description: "The runner for the setup" - required: true - type: string - target: - description: "The target for Rust" - required: true - type: string - -runs: - using: "composite" - 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 - shell: bash - - # 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 - # shell: bash - - - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v1 - with: - version: "17.0" - - - 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 - shell: bash - - - name: "Add rust target (Other)" - if: inputs.runner != 'macos-latest' - run: rustup target add ${{ inputs.target }} - shell: bash +# name: "Setup" +# description: "Setup environment for CI" +# inputs: +# runner: +# description: "The runner for the setup" +# required: true +# type: string +# target: +# description: "The target for Rust" +# required: true +# type: string + +# runs: +# using: "composite" +# 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 +# shell: bash + +# # 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 +# shell: bash + +# - 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 +# shell: bash + +# - name: "Add rust target (Other)" +# if: inputs.runner != 'macos-latest' +# run: rustup target add ${{ inputs.target }} +# shell: bash From 4084aa1e3ca6cbdbb41b3bd839548be5ec55c261 Mon Sep 17 00:00:00 2001 From: francis2tm Date: Fri, 9 Feb 2024 14:47:11 +0000 Subject: [PATCH 14/14] fix: change rust targets for macos --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e7a59f..63fb28a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,12 @@ jobs: with: components: rustfmt - - name: "Add rust target" + - 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 GUI frontend dependencies