xref: /freebsd/crypto/libecc/.github/workflows/libecc_crossarch_tests.yml (revision f0865ec9906d5a18fa2a3b61381f22ce16e606ad)
1*f0865ec9SKyle Evansname: libecc
2*f0865ec9SKyle Evans
3*f0865ec9SKyle Evans# Run this workflow every time a new commit pushed to your repository
4*f0865ec9SKyle Evanson: push
5*f0865ec9SKyle Evans
6*f0865ec9SKyle Evansjobs:
7*f0865ec9SKyle Evans  cross_arch_tests:
8*f0865ec9SKyle Evans    runs-on: ubuntu-20.04
9*f0865ec9SKyle Evans    strategy:
10*f0865ec9SKyle Evans      #max-parallel: 10
11*f0865ec9SKyle Evans      matrix:
12*f0865ec9SKyle Evans        blinding: [0, 1]
13*f0865ec9SKyle Evans        complete: [1]
14*f0865ec9SKyle Evans        ladder: [1]
15*f0865ec9SKyle Evans        #cross_target: [arm-linux-gnueabi, arm-linux-gnueabihf, aarch64-linux-gnu, powerpc64le-linux-gnu, mipsel-linux-gnu, i686-w64-mingw32, x86_64-w64-mingw32, i386-apple-darwin, x86_64-apple-darwin, x86_64h-apple-darwin]
16*f0865ec9SKyle Evans        cross_target: [arm-linux-gnueabi, arm-linux-gnueabihf, aarch64-linux-gnu, powerpc64le-linux-gnu, mipsel-linux-gnu, i686-w64-mingw32, x86_64-w64-mingw32]
17*f0865ec9SKyle Evans        cross_size: [16, 32, 64]
18*f0865ec9SKyle Evans    steps:
19*f0865ec9SKyle Evans      # Add swap because of possible out of memory issues
20*f0865ec9SKyle Evans      - name: Set Swap Space
21*f0865ec9SKyle Evans        uses: pierotofy/set-swap-space@master
22*f0865ec9SKyle Evans        with:
23*f0865ec9SKyle Evans          swap-size-gb: 10
24*f0865ec9SKyle Evans      # Checkout repository
25*f0865ec9SKyle Evans      - name: checkout repository
26*f0865ec9SKyle Evans        uses: actions/checkout@v2
27*f0865ec9SKyle Evans      # Run actions
28*f0865ec9SKyle Evans      # Cross build and cross run tests
29*f0865ec9SKyle Evans      - name: libecc cross-arch tests
30*f0865ec9SKyle Evans        env:
31*f0865ec9SKyle Evans          BLINDING: ${{ matrix.blinding }}
32*f0865ec9SKyle Evans          COMPLETE: ${{ matrix.complete }}
33*f0865ec9SKyle Evans          LADDER: ${{ matrix.ladder }}
34*f0865ec9SKyle Evans          CROSS_TARGET: ${{ matrix.cross_target }}
35*f0865ec9SKyle Evans          CROSS_SIZE: ${{ matrix.cross_size }}
36*f0865ec9SKyle Evans          CRYPTOFUZZ: 1
37*f0865ec9SKyle Evans        shell: bash
38*f0865ec9SKyle Evans        run: |
39*f0865ec9SKyle Evans          # Install stuff
40*f0865ec9SKyle Evans          sudo apt-get update;
41*f0865ec9SKyle Evans          # This oddity is due to ubuntu (18.04 and 20.04) issue with wine32 in
42*f0865ec9SKyle Evans          # githbub actions runners ...
43*f0865ec9SKyle Evans          sudo apt-get -y install software-properties-common;
44*f0865ec9SKyle Evans          sudo apt-add-repository "ppa:ondrej/php" -y;
45*f0865ec9SKyle Evans          sudo dpkg --add-architecture i386;
46*f0865ec9SKyle Evans          sudo apt-get update;
47*f0865ec9SKyle Evans          sudo apt-get -y install qemu-user-static wine-stable wine32 wine64;
48*f0865ec9SKyle Evans          # Cross build jobs
49*f0865ec9SKyle Evans          docker pull multiarch/crossbuild;
50*f0865ec9SKyle Evans          sh scripts/crossbuild.sh -triplet "${CROSS_TARGET}" "${CROSS_SIZE}";
51*f0865ec9SKyle Evans          # Check for errors
52*f0865ec9SKyle Evans          [ ! -z "$(ls -A scripts/crossbuild_out/error_log/)" ] && exit -1;
53*f0865ec9SKyle Evans          # Test generated cross binaries through qemu-static;
54*f0865ec9SKyle Evans          sh scripts/crossrun.sh -triplet "${CROSS_TARGET}" "${CROSS_SIZE}";
55*f0865ec9SKyle Evans        continue-on-error: false
56