Skip to content

chore(host): Upgrade dependencies #311

chore(host): Upgrade dependencies

chore(host): Upgrade dependencies #311

Workflow file for this run

name: CI
on:
pull_request:
types:
- opened
- reopened
- synchronize
push:
branches:
- master
env:
CARGO_TERM_COLOR: always
jobs:
extension:
name: Pack MailExtension
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Zip
run: |
pushd ./extension
zip -r -FS ../external-editor-revived.xpi *
- name: Artifacts
uses: actions/upload-artifact@v3
with:
name: thunderbird-extension
retention-days: 60
path: |
external-editor-revived.xpi
messaging_host:
name: Build, lint, and test messaging host
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
target: [x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl]
rust_toolchain: [stable]
experimental: [false]
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
rust_toolchain: nightly
experimental: true
- os: macos-latest
target: x86_64-apple-darwin
rust_toolchain: stable
experimental: false
- os: macos-latest
target: x86_64-apple-darwin
rust_toolchain: nightly
experimental: true
- os: windows-latest
target: x86_64-pc-windows-msvc
rust_toolchain: stable
experimental: false
- os: windows-latest
target: x86_64-pc-windows-msvc
rust_toolchain: nightly
experimental: true
steps:
- uses: actions/checkout@v4
- name: Cancel Previous Runs
if: contains(matrix.os, 'ubuntu')
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Install Rust Toolchain
id: rust_toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
components: rustfmt, clippy
- name: Add Linux Targets
if: contains(matrix.os, 'ubuntu')
run: |
rustup target add x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-musl
- name: Add macOS Targets
if: contains(matrix.os, 'macos')
run: |
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
- name: Determine Readable Target Name
id: readable_target
shell: bash
run: |
if [[ "${{ matrix.os }}" == "macos"* ]]; then
printf 'name=%s\n' "universal" >> $GITHUB_OUTPUT
exit 0
fi
case "${{ matrix.target }}" in
x86_64-unknown-linux-gnu)
printf 'name=%s\n' "gnu" >> $GITHUB_OUTPUT
;;
x86_64-unknown-linux-musl)
printf 'name=%s\n' "musl" >> $GITHUB_OUTPUT
;;
x86_64-pc-windows-msvc)
printf 'name=%s\n' "msvc" >> $GITHUB_OUTPUT
;;
esac
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: build-${{ runner.os }}-rustc-${{ steps.rust_toolchain.outputs.cachekey }}-target-${{ steps.readable_target.outputs.name }}-lock-${{ hashFiles('Cargo.lock') }}-git-${{ github.sha }}
restore-keys: |
build-${{ runner.os }}-rustc-${{ steps.rust_toolchain.outputs.cachekey }}-target-${{ steps.readable_target.outputs.name }}-lock-${{ hashFiles('Cargo.lock') }}-
build-${{ runner.os }}-rustc-${{ steps.rust_toolchain.outputs.cachekey }}-target-${{ steps.readable_target.outputs.name }}-
build-${{ runner.os }}-rustc-${{ steps.rust_toolchain.outputs.cachekey }}-
build-${{ runner.os }}-
- name: rustfmt
shell: bash
run: |
cargo fmt -- --check
- name: Clippy
shell: bash
run: |
cargo clippy --locked --target=${{ matrix.target }} -- -D warnings
cargo clippy --locked --tests --target=${{ matrix.target }} -- -D warnings
- name: Build (Linux, Windows)
if: "!contains(matrix.os, 'macos')"
shell: bash
run: |
cargo build --locked --release --target=${{ matrix.target }}
[[ "${{ matrix.os }}" == "windows"* ]] && EXT='.exe' || EXT=''
mv -f "target/${{ matrix.target }}/release/external-editor-revived${EXT}" "target/release/external-editor-revived${EXT}"
- name: Build (macOS, x86_64)
if: contains(matrix.os, 'macos')
shell: bash
run: |
cargo build --locked --release --target=x86_64-apple-darwin
- name: Build (macOS, aarch64)
if: contains(matrix.os, 'macos')
shell: bash
run: |
cargo build --locked --release --target=aarch64-apple-darwin
- name: macOS Universal Binary
if: contains(matrix.os, 'macos')
run: |
mkdir -p target/release/
lipo -create -output target/release/external-editor-revived target/x86_64-apple-darwin/release/external-editor-revived target/aarch64-apple-darwin/release/external-editor-revived
file target/release/external-editor-revived
- name: Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-${{ steps.readable_target.outputs.name }}-${{ matrix.rust_toolchain }}-native-messaging-host
retention-days: 60
path: |
target/release/external-editor-revived
target/release/external-editor-revived.exe
- name: Test
shell: bash
run: |
cargo test --locked --release --target=${{ matrix.target }}