Skip to content

Commit

Permalink
CI/Makefile: Update CI and Makefile to the new nano folder
Browse files Browse the repository at this point in the history
  • Loading branch information
spalmer25 committed Oct 18, 2023
1 parent 63cfe72 commit d18660e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 64 deletions.
69 changes: 18 additions & 51 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -114,74 +120,35 @@ 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: |
export PATH=/home/opam/.opam/4.14/bin:$PATH
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]
Expand Down Expand Up @@ -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
Expand Down
23 changes: 15 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -79,29 +79,36 @@ 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 \
integration_tests_basic_nanox \
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 \
Expand Down
6 changes: 3 additions & 3 deletions tests/generate/Makefile
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions tests/unit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d18660e

Please sign in to comment.