diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 5a9245e2e..f3603e9bd 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -47,38 +47,42 @@ jobs: with: version: 0.13.0 - # GitHub's CI runners for macos seem to alternate between using a x86 and an ARM machine - # which is annoying to handle and results in them having invalid hardware info configurations - # on the virtual machine. This leads to incorrect feature detection and the CI is flaky. - # - # If we at some point setup a self-hosted MacOS runner, we could work around the issue and - # enable full testing on MacOS! - name: build run: | - zig build -Dtarget=x86_64-linux -Dcpu=x86_64_v4 - zig build -Dtarget=aarch64-macos -Dcpu=apple_m3 - - test: - strategy: - matrix: - os: [ubuntu-latest] - runs-on: ${{matrix.os}} - timeout-minutes: 60 + zig build -Denable-tsan -p output/ + zig build test -Denable-tsan=true -Dblockstore=hashmap -Dfilter="ledger" -Dno-run -p output/tsan-test/ + + - name: cache + uses: actions/cache@v3 + with: + path: output/ + key: ${{ runner.os }}-zig-build-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-zig-build + + + # GitHub's CI runners for macos seem to alternate between using a x86 and an ARM machine + # which is annoying to handle and results in them having invalid hardware info configurations + # on the virtual machine. This leads to incorrect feature detection and the CI is flaky. + # + # If we at some point setup a self-hosted MacOS runner, we could work around the issue and + # enable full testing on MacOS! + build-macos: + name: Build macOS Artifacts + runs-on: macos-latest steps: - - name: checkout - uses: actions/checkout@v2 + - name: Checkout Code + uses: actions/checkout@v3 - - name: setup-zig + - name: Set Up Zig uses: mlugg/setup-zig@v1 with: version: 0.13.0 - - name: test - run: | - zig build test -Denable-tsan=true - zig build test -Denable-tsan=true -Dblockstore=hashmap -Dfilter="ledger" + - name: build + run: zig build -Dtarget=aarch64-macos -Dcpu=apple_m3 - kcov_test: + test: strategy: matrix: os: [ubuntu-latest] @@ -93,134 +97,162 @@ jobs: with: version: 0.13.0 - - name: Set up dependencies - run: sudo apt-get update + - name: Restore Linux Build Artifacts + uses: actions/cache@v3 + with: + path: output/ + key: ${{ runner.os }}-zig-build-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-zig-build - - name: install kcov + - name: test run: | - wget https://github.com/SimonKagstrom/kcov/releases/download/v42/kcov-amd64.tar.gz - sudo tar xf kcov-amd64.tar.gz -C / + output/zig-out/bin/test + output/tsan-test/bin/test + + # kcov_test: + # strategy: + # matrix: + # os: [ubuntu-latest] + # runs-on: ${{matrix.os}} + # timeout-minutes: 60 + # steps: + # - name: checkout + # uses: actions/checkout@v2 + + # - name: setup-zig + # uses: mlugg/setup-zig@v1 + # with: + # version: 0.13.0 + + # - name: Set up dependencies + # run: sudo apt-get update + + # - name: install kcov + # run: | + # wget https://github.com/SimonKagstrom/kcov/releases/download/v42/kcov-amd64.tar.gz + # sudo tar xf kcov-amd64.tar.gz -C / - - name: fix kcov dependencies - run: | - cd /usr/lib/x86_64-linux-gnu/ - sudo ln libopcodes-2.42-system.so libopcodes-2.38-system.so || echo libopcodes not found - sudo ln libbfd-2.42-system.so libbfd-2.38-system.so || echo libbfd not found + # - name: fix kcov dependencies + # run: | + # cd /usr/lib/x86_64-linux-gnu/ + # sudo ln libopcodes-2.42-system.so libopcodes-2.38-system.so || echo libopcodes not found + # sudo ln libbfd-2.42-system.so libbfd-2.38-system.so || echo libbfd not found - - name: run kcov - run: | - bash scripts/kcov_test.sh + # - name: run kcov + # run: | + # bash scripts/kcov_test.sh - - name: print coverage report - run: | - python scripts/parse_kcov.py kcov-output/test/coverage.json + # - name: print coverage report + # run: | + # python scripts/parse_kcov.py kcov-output/test/coverage.json - gossip: - strategy: - matrix: - os: [ubuntu-latest] - runs-on: ${{matrix.os}} - timeout-minutes: 60 - steps: - - name: checkout - uses: actions/checkout@v2 + # gossip: + # strategy: + # matrix: + # os: [ubuntu-latest] + # runs-on: ${{matrix.os}} + # timeout-minutes: 60 + # steps: + # - name: checkout + # uses: actions/checkout@v2 - - name: setup-zig - uses: mlugg/setup-zig@v1 - with: - version: 0.13.0 + # - name: setup-zig + # uses: mlugg/setup-zig@v1 + # with: + # version: 0.13.0 - - name: build release - run: zig build -Doptimize=ReleaseSafe + # - name: build release + # run: zig build -Doptimize=ReleaseSafe - - name: run gossip - run: bash scripts/gossip_test.sh 120 # in seconds + # - name: run gossip + # run: bash scripts/gossip_test.sh 120 # in seconds - gossip_service_fuzz: - strategy: - matrix: - os: [ubuntu-latest] - runs-on: ${{matrix.os}} - timeout-minutes: 60 - steps: - - name: checkout - uses: actions/checkout@v2 + # gossip_service_fuzz: + # strategy: + # matrix: + # os: [ubuntu-latest] + # runs-on: ${{matrix.os}} + # timeout-minutes: 60 + # steps: + # - name: checkout + # uses: actions/checkout@v2 - - name: setup zig - uses: mlugg/setup-zig@v1 - with: - version: 0.13.0 + # - name: setup zig + # uses: mlugg/setup-zig@v1 + # with: + # version: 0.13.0 - - name: build - run: zig build -Doptimize=ReleaseSafe -Dno-run fuzz + # - name: build + # run: zig build -Doptimize=ReleaseSafe -Dno-run fuzz - - name: run - run: ./zig-out/bin/fuzz gossip_service 19 10000 + # - name: run + # run: ./zig-out/bin/fuzz gossip_service 19 10000 - gossip_table_fuzz: - strategy: - matrix: - os: [ubuntu-latest] - runs-on: ${{matrix.os}} - timeout-minutes: 60 - steps: - - name: checkout - uses: actions/checkout@v2 + # gossip_table_fuzz: + # strategy: + # matrix: + # os: [ubuntu-latest] + # runs-on: ${{matrix.os}} + # timeout-minutes: 60 + # steps: + # - name: checkout + # uses: actions/checkout@v2 - with: - submodules: recursive + # with: + # submodules: recursive - - name: setup zig - uses: mlugg/setup-zig@v1 - with: - version: 0.13.0 + # - name: setup zig + # uses: mlugg/setup-zig@v1 + # with: + # version: 0.13.0 - - name: build - run: zig build -Doptimize=ReleaseSafe -Dno-run fuzz + # - name: build + # run: zig build -Doptimize=ReleaseSafe -Dno-run fuzz - - name: run - run: ./zig-out/bin/fuzz gossip_table 19 100000 + # - name: run + # run: ./zig-out/bin/fuzz gossip_table 19 100000 - allocators_fuzz: - strategy: - matrix: - os: [ubuntu-latest] - runs-on: ${{matrix.os}} - timeout-minutes: 60 - steps: - - name: checkout - uses: actions/checkout@v2 + # allocators_fuzz: + # strategy: + # matrix: + # os: [ubuntu-latest] + # runs-on: ${{matrix.os}} + # timeout-minutes: 60 + # steps: + # - name: checkout + # uses: actions/checkout@v2 - - name: setup zig - uses: mlugg/setup-zig@v1 - with: - version: 0.13.0 + # - name: setup zig + # uses: mlugg/setup-zig@v1 + # with: + # version: 0.13.0 - - name: build - run: zig build -Doptimize=ReleaseSafe -Dno-run fuzz + # - name: build + # run: zig build -Doptimize=ReleaseSafe -Dno-run fuzz - - name: run - run: ./zig-out/bin/fuzz allocators 19 10000 + # - name: run + # run: ./zig-out/bin/fuzz allocators 19 10000 - ledger_fuzz: - strategy: - matrix: - os: [ubuntu-latest] - runs-on: ${{matrix.os}} - timeout-minutes: 60 - steps: - - name: checkout - uses: actions/checkout@v2 - with: - submodules: recursive - - name: setup zig - uses: mlugg/setup-zig@v1 - with: - version: 0.13.0 - - name: build - run: zig build -Doptimize=ReleaseSafe -Dno-run fuzz - - name: run - run: ./zig-out/bin/fuzz ledger 19 10000 + # ledger_fuzz: + # strategy: + # matrix: + # os: [ubuntu-latest] + # runs-on: ${{matrix.os}} + # timeout-minutes: 60 + # steps: + # - name: checkout + # uses: actions/checkout@v2 + # with: + # submodules: recursive + # - name: setup zig + # uses: mlugg/setup-zig@v1 + # with: + # version: 0.13.0 + # - name: build + # run: zig build -Doptimize=ReleaseSafe -Dno-run fuzz + # - name: run + # run: ./zig-out/bin/fuzz ledger 19 10000 # benchmarks: # if: ${{ github.ref != 'refs/heads/main' }}