Skip to content

Commit

Permalink
Mettre à jour le compilateur croisé (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ftmazzone authored Sep 26, 2024
1 parent 902da39 commit 685229d
Show file tree
Hide file tree
Showing 5 changed files with 863 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .cargo/config-compilation-croisee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[target.arm-unknown-linux-gnueabihf]
linker = "./cross-pi-gcc-10.3.0-0/bin/arm-linux-gnueabihf-gcc"
linker = "./cross-pi-gcc-12.2.0-0/bin/arm-linux-gnueabihf-gcc"
rustflags = [
"-C", "link-arg=-march=armv6",
"-C","link-arg=-mfloat-abi=hard",
Expand Down
57 changes: 45 additions & 12 deletions .github/workflows/construction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,54 @@ env:
CARGO_HOME: /tmp/cache/cargo
BRANCHE_GIT: ${{ github.head_ref || github.ref_name }}
jobs:
construire:
runs-on: ubuntu-latest
timeout-minutes: 10
# if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Rechercher si le répertoire des dépendances est en mémoire temporaire
id: registry-cargo
uses: actions/cache@v4
with:
path: ${{ env.CARGO_HOME }}
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-registry-Cargo.lock
restore-keys: |
${{ runner.os }}-registry-Cargo.lock
- name: Rechercher si le répertoire de construction est en mémoire temporaire
id: target-cargo
uses: actions/cache@v4
with:
path: ./target
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-target-Cargo.lock
restore-keys: |
${{ runner.os }}-target-Cargo.lock
- name: Construire l'application
run: |
rustup --version
cargo --version
cargo build --release --example lire_temperature
- uses: actions/upload-artifact@v4
with:
name: lire_temperature
path: ./target/release/examples/lire_temperature
retention-days: 31
if-no-files-found: error
construire-armv6:
runs-on: ubuntu-latest
timeout-minutes: 10
# if: github.ref == 'refs/heads/master'
env:
COMPILATEUR_CROISE: cross-gcc-10.3.0-pi_0-1.tar.gz
ADRESSE_COMPILATEUR_CROISE: https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bullseye/GCC%2010.3.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-10.3.0-pi_0-1.tar.gz/download -O cross-gcc-10.3.0-pi_0-1.tar.gz
COMPILATEUR_CROISE: cross-gcc-12.2.0-pi_0-1.tar.gz
ADRESSE_COMPILATEUR_CROISE: https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bookworm/GCC%2012.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-12.2.0-pi_0-1.tar.gz/download -O cross-gcc-12.2.0-pi_0-1.tar.gz
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Rechercher si le compilateur croisé pour Raspberry Pi Zero est en mémoire temporaire
id: compilateur-croise
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./${{ env.COMPILATEUR_CROISE }}
key: ${{ runner.os }}-${{ hashFiles(env.COMPILATEUR_CROISE) }}-${{ env.COMPILATEUR_CROISE }}
key: ${{ runner.os }}-${{ env.COMPILATEUR_CROISE }}
- name: Télécharger le compilateur croisé pour Raspberry Pi Zero
if: steps.compilateur-croise.outputs.cache-hit != 'true'
run: wget $ADRESSE_COMPILATEUR_CROISE
Expand All @@ -38,26 +71,26 @@ jobs:
mv .cargo/config-compilation-croisee .cargo/config
- name: Rechercher si le répertoire des dépendances est en mémoire temporaire
id: registry-cargo
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.CARGO_HOME }}
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-registry-Cargo.lock
key: ${{ runner.os }}-${{ env.COMPILATEUR_CROISE }}-${{ hashFiles('Cargo.lock') }}-registry-Cargo.lock
restore-keys: |
${{ runner.os }}-registry-Cargo.lock
${{ runner.os }}-${{ env.COMPILATEUR_CROISE }}-registry-Cargo.lock
- name: Rechercher si le répertoire de construction est en mémoire temporaire
id: target-cargo
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./target
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-target-Cargo.lock
key: ${{ runner.os }}-${{ env.COMPILATEUR_CROISE }}-${{ hashFiles('Cargo.lock') }}-target-Cargo.lock
restore-keys: |
${{ runner.os }}-target-Cargo.lock
${{ runner.os }}-${{ env.COMPILATEUR_CROISE }}-target-Cargo.lock
- name: Construire l'application
run: |
rustup --version
cargo --version
cargo build --release --target arm-unknown-linux-gnueabihf --example lire_temperature
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: lire_temperature_armv6
path: ./target/arm-unknown-linux-gnueabihf/release/examples/lire_temperature
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk
Loading

0 comments on commit 685229d

Please sign in to comment.