From d18660e9aa96e2f8fc70988f7dbbdee450683e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Palmer?= Date: Wed, 18 Oct 2023 14:37:08 +0200 Subject: [PATCH] CI/Makefile: Update CI and Makefile to the new nano folder --- .github/workflows/build.yml | 69 ++++++++++--------------------------- Makefile | 23 ++++++++----- tests/generate/Makefile | 6 ++-- tests/unit/Makefile | 4 +-- 4 files changed, 38 insertions(+), 64 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7c7bed2b..c2f589a5c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,6 +64,12 @@ jobs: fail-fast: false matrix: device: [nanos, nanosp, nanox, stax] + env: + DEVICE_KIND: | + ${{ if eq(matrix.device, 'nanos') || eq(matrix.device, 'nanosp') || eq(matrix.device, 'nanox') }}: + nano + ${{ else }}: + stax container: image: ${{ needs.build_docker_integration_tests.outputs.image }} credentials: @@ -90,7 +96,7 @@ jobs: - name: Run test run: | ./tests/integration/run_test_local.sh -F -m ${{ matrix.device }} \ - ./tests/integration/${{ matrix.device }} + ./tests/integration/${{ DEVICE_KIND }} - name: Upload results uses: actions/upload-artifact@v3 @@ -114,33 +120,17 @@ jobs: - name: Create dirs run: | - mkdir -p tests/samples/micheline/nanos - mkdir -p tests/samples/operations/nanos - - mkdir -p tests/samples/micheline/nanosp - mkdir -p tests/samples/operations/nanosp - - mkdir -p tests/samples/micheline/nanox - mkdir -p tests/samples/operations/nanox + mkdir -p tests/samples/micheline/nano + mkdir -p tests/samples/operations/nano - name: Generate run: | export PATH=/home/opam/.opam/4.14/bin:$PATH dune exec ./tests/generate/generate.exe micheline 500 \ - nanos tests/samples/micheline - dune exec ./tests/generate/generate.exe operations 500 \ - nanos tests/samples/operations - - dune exec ./tests/generate/generate.exe micheline 500 \ - nanosp tests/samples/micheline + nano tests/samples/micheline dune exec ./tests/generate/generate.exe operations 500 \ - nanosp tests/samples/operations \ - - dune exec ./tests/generate/generate.exe micheline 500 \ - nanox tests/samples/micheline - dune exec ./tests/generate/generate.exe operations 500 \ - nanox tests/samples/operations + nano tests/samples/operations - name: Unit tests run: | @@ -148,40 +138,17 @@ jobs: make -C tests/unit - - name: Upload results (nanos, micheline) - uses: actions/upload-artifact@v3 - with: - name: nanos_samples_micheline - path: tests/samples/micheline/nanos - - name: Upload results (nanos, operations) - uses: actions/upload-artifact@v3 - with: - name: nanos_samples_operations - path: tests/samples/operations/nanos - - - name: Upload results (nanosp, micheline) - uses: actions/upload-artifact@v3 - with: - name: nanosp_samples_micheline - path: tests/samples/micheline/nanosp - - - name: Upload results (nanosp, operations) - uses: actions/upload-artifact@v3 - with: - name: nanosp_samples_operations - path: tests/samples/operations/nanosp - - - name: Upload results (nanox, micheline) + - name: Upload results (nano, micheline) uses: actions/upload-artifact@v3 with: - name: nanox_samples_micheline - path: tests/samples/micheline/nanox + name: nano_samples_micheline + path: tests/samples/micheline/nano - - name: Upload results (nanox, operations) + - name: Upload results (nano, operations) uses: actions/upload-artifact@v3 with: - name: nanox_samples_operations - path: tests/samples/operations/nanox + name: nano_samples_operations + path: tests/samples/operations/nano integration_tests_samples: needs: [build_app, generate_samples_unit_tests, build_docker_integration_tests] @@ -213,7 +180,7 @@ jobs: - name: Download samples uses: actions/download-artifact@v3 with: - name: ${{ matrix.device }}_samples_${{ matrix.type }} + name: nano_samples_${{ matrix.type }} path: tests - name: Test diff --git a/Makefile b/Makefile index 9fd19d712..124ba79b8 100644 --- a/Makefile +++ b/Makefile @@ -69,8 +69,8 @@ clean: $(DOCKER_RUN_APP_BUILDER) make -C app mrproper $(DOCKER_RUN_APP_OCAML) bash -c "make -C /app/tests/generate clean && cd /app && rm -rf _build" -unit_tests: test/samples/micheline/nanos/samples.hex \ - test/samples/operations/nanos/samples.hex \ +unit_tests: test/samples/micheline/nano/samples.hex \ + test/samples/operations/nano/samples.hex \ tests/unit/*.ml* \ tests/unit/*.[ch] \ tests/unit/dune \ @@ -79,11 +79,17 @@ unit_tests: test/samples/micheline/nanos/samples.hex \ RUN_TEST_DOCKER = ./tests/integration/run_test_docker.sh +integration_tests_basic_stax: app_stax.tgz \ + app_stax_dbg.tgz \ + tests/integration/* \ + tests/integration/stax/* + $(RUN_TEST_DOCKER) stax tests/integration/stax + integration_tests_basic_%: app_%.tgz \ app_%_dbg.tgz \ tests/integration/* \ - tests/integration/%/* - $(RUN_TEST_DOCKER) $* tests/integration/$* + tests/integration/nano/* + $(RUN_TEST_DOCKER) $* tests/integration/nano integration_tests_basic: integration_tests_basic_nanos \ integration_tests_basic_nanosp \ @@ -91,17 +97,18 @@ integration_tests_basic: integration_tests_basic_nanos \ integration_tests_basic_stax integration_tests_%: integration_tests_basic_% \ - test/samples/operations/%/samples.hex \ - test/samples/micheline/%/samples.hex \ + test/samples/operations/nano/samples.hex \ + test/samples/micheline/nano/samples.hex \ tests/integration/*.sh $(RUN_TEST_DOCKER) $* \ - tests/samples/micheline/$* \ - tests/samples/operations/$* + tests/samples/micheline/nano \ + tests/samples/operations/nano integration_tests: tests/integration/*.sh \ integration_tests_nanos \ integration_tests_nanosp \ integration_tests_nanox \ + integration_tests_basic_stax test/samples/micheline/%/samples.hex: tests/generate/*.ml* \ tests/generate/dune \ diff --git a/tests/generate/Makefile b/tests/generate/Makefile index 45aa0b9cc..9e8d74aad 100644 --- a/tests/generate/Makefile +++ b/tests/generate/Makefile @@ -1,15 +1,15 @@ -.PHONY: nanos nanosp nanox +.PHONY: nano stax nanos: nanosp: nanox: ../samples/micheline/%/samples.hex: % *.ml* dune Makefile mkdir -p ../samples/micheline/$< - dune exec ./generate.exe micheline 1000 $< ../samples/micheline/ + dune exec ./generate.exe micheline 100 $< ../samples/micheline/ ../samples/operations/%/samples.hex: % *.ml* dune Makefile mkdir -p ../samples/operations/$< - dune exec ./generate.exe operations 1000 $< ../samples/operations/ + dune exec ./generate.exe operations 100 $< ../samples/operations/ clean: rm -rf ../samples diff --git a/tests/unit/Makefile b/tests/unit/Makefile index 35070baa8..2d6a0d30d 100644 --- a/tests/unit/Makefile +++ b/tests/unit/Makefile @@ -3,7 +3,7 @@ all: test_micheline_c_parser test_operations_c_parser test_micheline_c_parser: *.ml *.[ch] dune Makefile - dune exec ./test_c_parser.exe micheline ../samples/micheline/nanos/samples.hex + dune exec ./test_c_parser.exe micheline ../samples/micheline/nano/samples.hex test_operations_c_parser: *.ml *.[ch] dune Makefile - dune exec ./test_c_parser.exe operations ../samples/operations/nanos/samples.hex + dune exec ./test_c_parser.exe operations ../samples/operations/nano/samples.hex