pipeline {

    agent {
        dockerfile {
            dir 'automation'
            reuseNode true
        }
    }

    stages {
        stage('Clippy') {
            steps {
                sh 'cargo clippy'
            }
        }
        stage('Rustfmt') {
            steps {
                sh 'cargo fmt'
            }
        }
        stage('Test') {
            steps {
                sh 'cargo test'
            }
        }
        stage('Check') {
            steps {
                sh 'cargo check'
            }
        }
        stage('Check Cross Embedded Bare Metal') {
            steps {
                sh 'cargo check --target thumbv7em-none-eabihf --no-default-features'
            }
        }
        stage('Check Cross Embedded Linux') {
            steps {
                sh 'cargo check --target armv7-unknown-linux-gnueabihf'
            }
        }
    }
}