Mettre à jour le compilateur croisé #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Construction de l'exemple | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
schedule: | |
- cron: '0 0 15 * *' | |
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_armv6 | |
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-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@v4 | |
- name: Rechercher si le compilateur croisé pour Raspberry Pi Zero est en mémoire temporaire | |
id: compilateur-croise | |
uses: actions/cache@v4 | |
with: | |
path: ./${{ env.COMPILATEUR_CROISE }} | |
key: ${{ runner.os }}-${{ hashFiles(env.COMPILATEUR_CROISE) }}-${{ 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 | |
- name: Préparer le compilateur pour la compilation croisée ARMv6 | |
run: | | |
sudo apt-get install gcc-arm-linux-gnueabihf wget libssl-dev pkg-config make perl | |
rustup target add arm-unknown-linux-gnueabihf | |
git clone https://github.com/abhiTronix/raspberry-pi-cross-compilers.git | |
tar -xf $COMPILATEUR_CROISE | |
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@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 --target arm-unknown-linux-gnueabihf --example lire_temperature | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: lire_temperature_armv6 | |
path: ./target/arm-unknown-linux-gnueabihf/release/examples/lire_temperature | |
retention-days: 31 | |
if-no-files-found: error |