From 36714befd593843edbed2606f59f5071fdd35250 Mon Sep 17 00:00:00 2001
From: DETCHART Jonathan <jonathan.detchart@isae.fr>
Date: Wed, 13 Nov 2024 13:58:52 +0000
Subject: [PATCH] Adding a Github workflow (dragoon/komodo!177)

---
 .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 .github/workflows/ci.yml

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..3fe89340
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,47 @@
+name: Rust CI
+
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+  workflow_dispatch:
+
+jobs:
+  fmt:
+    runs-on: ubuntu-latest
+    if: "!contains(github.event.head_commit.message, 'draft:') && !contains(github.event.head_commit.message, 'no-ci:')"
+    steps:
+      - uses: actions/checkout@v3
+      - name: Set up Rust
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+      - name: Run fmt check
+        run: make fmt-check
+
+  test:
+    runs-on: ubuntu-latest
+    env:
+      NUSHELL_ARCH: 'x86_64-unknown-linux-musl'
+      NUSHELL_VERSION: '0.95.0'
+    needs: fmt
+    if: "!contains(github.event.head_commit.message, 'draft:') && !contains(github.event.head_commit.message, 'no-ci:')"
+    steps:
+      - uses: actions/checkout@v3
+      - name: Install dependencies
+        run: |
+          sudo apt update --yes
+          sudo apt upgrade --yes
+          sudo apt install protobuf-compiler --yes
+      - name: Install Nushell
+        run: |
+          curl -fLo /tmp/nu.tar.gz "https://github.com/nushell/nushell/releases/download/$NUSHELL_VERSION/nu-$NUSHELL_VERSION-$NUSHELL_ARCH.tar.gz"
+          tar xvf /tmp/nu.tar.gz --directory /tmp
+          cp "/tmp/nu-$NUSHELL_VERSION-$NUSHELL_ARCH/nu" /tmp/nu
+          echo "PATH=/tmp/:$PATH" >> $GITHUB_ENV
+      - name: Show configuration
+        run: make show
+      - name: Run tests
+        run: |
+          make check clippy test example
-- 
GitLab