diff --git a/.github/native-test.yml b/.github/native-test.yml deleted file mode 100644 index ed7da06..0000000 --- a/.github/native-test.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Test on Native - -on: - pull_request: - branches: - - '**' - - workflow_dispatch: - - - -jobs: - test-native: - runs-on: ubuntu-latest - - steps: - - name: Checkout avionics repo - uses: actions/checkout@v4 - with: - path: avionics - - - name: Clone Native repo - run: | - git clone https://github.com/CURocketEngineering/Native native - - - name: Replace Native lib avionics with checked-out avionics code - run: | - rm -rf native/lib/avionics - mkdir -p native/lib - mv avionics native/lib/avionics - - - name: Download Rocket-test-data v1.0.0 release CSVs - run: | - mkdir -p native/data - - curl -s https://api.github.com/repos/CURocketEngineering/Rocket-test-data/releases/tags/v1.0.0 \ - | jq -r '.assets[].browser_download_url' \ - | while read url; do - echo "Downloading $url" - curl -L "$url" -o native/data/$(basename "$url") - done - - - name: Install PlatformIO Core - run: | - pip install -U platformio - - - name: Run PlatformIO Tests - working-directory: ./native - run: | - pio test -e native diff --git a/.github/workflows/native-test.yml b/.github/workflows/native-test.yml new file mode 100644 index 0000000..1452c6f --- /dev/null +++ b/.github/workflows/native-test.yml @@ -0,0 +1,80 @@ +name: Test With Native + +on: + #triggers the workflow on pull requests + pull_request: + branches: + - '**' + + #allows manual triggering of the workflow + workflow_dispatch: + +jobs: + test-native: + runs-on: ubuntu-latest + + steps: + #gets the current repo + - name: Checkout avionics repo + uses: actions/checkout@v4 + with: + path: avionics + + #clones the native repo + - name: Clone Native repo + run: | + git clone https://github.com/CURocketEngineering/Native native + + #replaces the linked avionics repo with the current avionics code + - name: Replace Native lib avionics with checked-out avionics code + run: | + rm -rf native/lib/avionics + mkdir -p native/lib + mv avionics native/lib/avionics + + #downlaods the rocket-test-data for the test + - name: Download Rocket-test-data v1.0.0 release CSVs + run: | + mkdir -p native/data + curl -s \ + -H "Accept: application/vnd.github+json" \ + https://api.github.com/repos/CURocketEngineering/Rocket-Test-Data/releases/tags/v1.0.0 \ + | jq -r '.assets[].browser_download_url' \ + | while read url; do + echo "Downloading $url" + curl -L "$url" -o native/data/$(basename "$url") + done + + #fixes the file name replacing the . with spaces + - name: Fix file name + run: | + mv native/data/AA.Data.Collection.-.Second.Launch.Trimmed.csv \ + native/data/"AA Data Collection - Second Launch Trimmed.csv" + + #installed PlatformIO core + - name: Install PlatformIO Core + run: | + pip install -U platformio + #shows the file tree structure for debugging + - name: Show native directory structure + run: | + echo "===== native directory tree =====" + ls -R native + + #used to allow non-standard C++ code + - name: Make CI permissive for all tests + working-directory: ./native + run: | + echo " + [env:native] + build_flags = + -fpermissive + -Wno-pedantic + -Wno-error + " >> platformio.ini + + #runs platformio test + - name: Run PlatformIO Tests + working-directory: ./native + run: | + pio test -e native