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

Update CI deployment #139

Merged
merged 3 commits into from
Jul 15, 2024
Merged
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
40 changes: 23 additions & 17 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,14 @@ jobs:
- os: macos-latest
TARGET: aarch64-apple-darwin

- os: macos-latest
TARGET: x86_64-apple-darwin

- os: ubuntu-latest
TARGET: arm-unknown-linux-musleabihf
TARGET: aarch64-unknown-linux-gnu

- os: ubuntu-latest
TARGET: armv7-unknown-linux-musleabihf
TARGET: armv7-unknown-linux-gnueabihf

- os: ubuntu-latest
TARGET: x86_64-unknown-linux-musl
TARGET: x86_64-unknown-linux-gnu

- os: windows-latest
TARGET: x86_64-pc-windows-msvc
Expand All @@ -135,17 +132,26 @@ jobs:
run: echo "${{ matrix.TARGET }}"

- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1.0.1
with:
toolchain: stable
target: ${{ matrix.TARGET }}
override: true

- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --verbose --release --target=${{ matrix.TARGET }}
- name: Install build dependencies - Rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable --profile default --target ${{ matrix.TARGET }} -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
Comment on lines +135 to +138
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this instead of using actions-rs/toolchain?

Copy link
Contributor Author

@patrickelectric patrickelectric Jul 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This action is deprecated/archived and I think that the usage is not recommended.
image

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrickelectric did you consider using dtolnay/rust-toolchain? Its what I've done in my own little hotfix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @9SMTM6! Ill take a look.

Copy link

@9SMTM6 9SMTM6 Jul 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrickelectric I'm currently testing a pretty big rewrite of this toolchain on my app. So perhaps wait.

One of the core issues was the heavy usage of cross. I was able to remove all usages of cross other than for arm64 linux. The other was that this PR still leaves A LOT of uses of actions-rs in the pipeline. A bunch of toolchain commands, which I had removed earier in my pipeline, but also a bunch of action-rs/cargo etc actions, I have overlooked these in my own toolchain too.

# For linux, it's necessary to use cross from the git repository to avoid glibc problems
# Ref: https://github.com/cross-rs/cross/issues/1510
- name: Install cross for linux
if: contains(matrix.TARGET, 'linux')
run: |
cargo install cross --git https://github.com/cross-rs/cross --rev 1b8cf50d20180c1a394099e608141480f934b7f7
- name: Install cross for mac and windows
if: ${{ !contains(matrix.TARGET, 'linux') }}
run: |
cargo install cross
- name: Build
run: |
cross build --verbose --release --target=${{ matrix.TARGET }}
- name: Rename
run: cp target/${{ matrix.TARGET }}/release/eframe_template${{ matrix.EXTENSION }} eframe_template-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
Expand Down
Loading