|
| 1 | +name: "CI - Nix" |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + pull_request: |
| 7 | + branches: |
| 8 | + - main |
| 9 | +jobs: |
| 10 | + populate-cache: |
| 11 | + name: "${{ matrix.build }} on ${{ matrix.os }}" |
| 12 | + runs-on: "${{ matrix.os }}" |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + # os: TODO [macos-15, ubuntu-24.04] |
| 17 | + os: [ubuntu-24.04] |
| 18 | + build: ["mc-rtc-superbuild", devShells.x86_64-linux.mc-rtc-superbuild"] |
| 19 | + # build: ["pinocchio", "py-aligator", "gepetto-viewer", "devShells.x86_64-linux.hpp", "devShells.x86_64-linux.hpp-bin", "python"] |
| 20 | + # include: |
| 21 | + # - os: macos-15-intel |
| 22 | + # build: py-aligator |
| 23 | + # - os: ubuntu-24.04-arm |
| 24 | + # build: coal |
| 25 | + # - os: ubuntu-24.04-arm |
| 26 | + # build: proxsuite |
| 27 | + # - os: ubuntu-24.04-arm |
| 28 | + # build: py-casadi |
| 29 | + # - os: ubuntu-24.04-arm |
| 30 | + # build: aligator |
| 31 | + # - os: ubuntu-24.04-arm |
| 32 | + # build: py-aligator |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v6 |
| 35 | + - uses: cachix/install-nix-action@v31 |
| 36 | + - uses: cachix/cachix-action@v17 |
| 37 | + with: |
| 38 | + name: mc-rtc-nix |
| 39 | + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' |
| 40 | + - run: nix build -L ".#${{ matrix.build }}" --cores 4 |
| 41 | + complete: |
| 42 | + needs: populate-cache |
| 43 | + name: "complete ${{ matrix.os }}" |
| 44 | + runs-on: "${{ matrix.os }}-latest" |
| 45 | + strategy: |
| 46 | + fail-fast: false |
| 47 | + matrix: |
| 48 | + os: [ubuntu] # TODO: macos |
| 49 | + steps: |
| 50 | + - uses: jlumbroso/free-disk-space@main |
| 51 | + if: ${{ matrix.os == 'ubuntu' }} |
| 52 | + - uses: actions/checkout@v6 |
| 53 | + - uses: cachix/install-nix-action@v31 |
| 54 | + - uses: cachix/cachix-action@v17 |
| 55 | + with: |
| 56 | + name: mc-rtc-nix |
| 57 | + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' |
| 58 | + - run: nix flake check -L |
| 59 | + fallback: |
| 60 | + needs: complete |
| 61 | + if: always() && needs.complete.result == 'failure' |
| 62 | + name: "fallback ${{ matrix.os }}" |
| 63 | + runs-on: "${{ matrix.os }}-latest" |
| 64 | + strategy: |
| 65 | + fail-fast: false |
| 66 | + matrix: |
| 67 | + os: [ubuntu] # TODO: macos |
| 68 | + steps: |
| 69 | + - uses: jlumbroso/free-disk-space@main |
| 70 | + if: ${{ matrix.os == 'ubuntu' }} |
| 71 | + - uses: actions/checkout@v6 |
| 72 | + - uses: cachix/install-nix-action@v31 |
| 73 | + - uses: cachix/cachix-action@v17 |
| 74 | + with: |
| 75 | + name: mc-rtc-nix |
| 76 | + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' |
| 77 | + - run: nix flake check -L -j 1 --cores 1 |
| 78 | + system: |
| 79 | + runs-on: "ubuntu-latest" |
| 80 | + steps: |
| 81 | + - uses: actions/checkout@v6 |
| 82 | + - uses: cachix/install-nix-action@v31 |
| 83 | + - uses: cachix/cachix-action@v17 |
| 84 | + with: |
| 85 | + name: mc-rtc-nix |
| 86 | + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' |
| 87 | + extraPullNames: ros |
| 88 | + - run: nix build -L .#systemConfigs.default |
| 89 | + home: |
| 90 | + runs-on: "ubuntu-latest" |
| 91 | + steps: |
| 92 | + - uses: actions/checkout@v6 |
| 93 | + - uses: cachix/install-nix-action@v31 |
| 94 | + - uses: cachix/cachix-action@v17 |
| 95 | + with: |
| 96 | + name: mc-rtc-nix |
| 97 | + - run: nix build -L .#homeConfigurations.cpene.activationPackage |
| 98 | + check: |
| 99 | + if: always() |
| 100 | + name: check-macos-linux-nix |
| 101 | + runs-on: ubuntu-latest |
| 102 | + needs: |
| 103 | + - fallback |
| 104 | + - system |
| 105 | + - home |
| 106 | + steps: |
| 107 | + - uses: re-actors/alls-green@release/v1 |
| 108 | + with: |
| 109 | + allowed-skips: fallback |
| 110 | + jobs: ${{ toJSON(needs) }} |
| 111 | + |
0 commit comments