1+ # build variants.private and variants.private-ccache
2+ # push cache to mc-rtc-nix-private attic
3+ # TODO we cannot use nix flake check to ensure that everything is built
4+ # so currently we build the largest meta-packages available (mc-rtc-superbuild-private, mc-mujoco-full, etc)
15name : " CI - Nix - Private"
26on :
37 push :
@@ -13,14 +17,14 @@ jobs:
1317 # - The PR's source repo is the same as the base repo.
1418 # This is done to make sure that the required secrets are available to the CI
1519 if : github.event_name != 'pull_request' || github.repository == github.event.pull_request.head.repo.full_name
16- name : " ${{ matrix.build }} on ${{ matrix.os }}"
20+ name : " ${{matrix.variant}}: ${{ matrix.build }} on ${{ matrix.os }}"
1721 runs-on : " ${{ matrix.os }}"
1822 strategy :
1923 fail-fast : false
2024 matrix :
2125 os : [ubuntu-24.04]
22- # test with mc-hrp2 for now
23- build : [ "mc-hrp2 ", "mc-rtc-superbuild-private" ]
26+ variant : [ "private", "private-ccache" ]
27+ build : [ "mc-mujoco-full ", "mc-rtc-superbuild-private" ]
2428 steps :
2529 - uses : actions/checkout@v6
2630 # Configures ssh-agent if SSH_KEY secret exists
@@ -44,37 +48,18 @@ jobs:
4448 endpoint : https://attic.arntanguy.fr
4549 cache : mc-rtc-nix-private
4650 token : ${{ secrets.ATTIC_TOKEN }}
47- - run : nix build -L "./private#${{ matrix.build }}" --cores 4
48- complete :
49- if : github.event_name != 'pull_request' || github.repository == github.event.pull_request.head.repo.full_name
50- needs : populate-cache
51- name : " complete ${{ matrix.os }}"
52- runs-on : " ${{ matrix.os }}-latest"
53- strategy :
54- fail-fast : false
55- matrix :
56- os : [ubuntu] # TODO: macos
57- steps :
58- - uses : jlumbroso/free-disk-space@main
59- if : ${{ matrix.os == 'ubuntu' }}
60- - name : Configure ssh-agent
61- uses : webfactory/ssh-agent@v0.9.0
62- with :
63- ssh-private-key : ${{ secrets.SSH_KEY }}
64- - name : Add gite.lirmm.fr to known_hosts
51+ - name : Setup ccache environment
6552 run : |
66- ssh-keyscan gite.lirmm.fr >> ~/.ssh/known_hosts
67- - uses : actions/checkout@v6
68- - uses : cachix/install-nix-action@v31
69- - uses : cachix/cachix-action@v17
70- with :
71- name : mc-rtc-nix
72- authToken : ' ${{ secrets.CACHIX_AUTH_TOKEN }}'
73- extraPullNames : " ros,gepetto"
74- - run : nix flake check -L ./private
53+ sudo mkdir -m0770 -p '/var/cache/ccache'
54+ sudo chown --reference=/nix/store '/var/cache/ccache'
55+ mkdir -p ~/.config/nix
56+ echo 'extra-sandbox-paths = /var/cache/ccache' | sudo tee -a /etc/nix/nix.conf
57+ sudo systemctl restart nix-daemon.service
58+ sudo ls -ld /var/cache/ccache
59+ - run : nix build -L ".#variants.${{ matrix.variant }}.packages.x86_64-linux.${{ matrix.build }}" --cores 4
7560 fallback :
76- needs : complete
77- if : always() && needs.complete .result == 'failure'
61+ needs : populate-cache
62+ if : always() && needs.populate-cache .result == 'failure'
7863 name : " fallback ${{ matrix.os }}"
7964 runs-on : " ${{ matrix.os }}-latest"
8065 strategy :
@@ -98,36 +83,13 @@ jobs:
9883 name : mc-rtc-nix
9984 authToken : ' ${{ secrets.CACHIX_AUTH_TOKEN }}'
10085 extraPullNames : " ros,gepetto"
101- - run : nix flake check -L -j 1 --cores 1
102- # system:
103- # runs-on: "ubuntu-latest"
104- # steps:
105- # - uses: actions/checkout@v6
106- # - uses: cachix/install-nix-action@v31
107- # - uses: cachix/cachix-action@v17
108- # with:
109- # name: mc-rtc-nix
110- # authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
111- # extraPullNames: ros
112- # - run: nix build -L .#systemConfigs.default
113- # home:
114- # runs-on: "ubuntu-latest"
115- # steps:
116- # - uses: actions/checkout@v6
117- # - uses: cachix/install-nix-action@v31
118- # - uses: cachix/cachix-action@v17
119- # with:
120- # name: mc-rtc-nix
121- # extraPullNames: "ros,gepetto"
122- # - run: nix build -L .#homeConfigurations.cpene.activationPackage
86+ - run : nix build -L ".#variants.${{ matrix.variant }}.packages.x86_64-linux.${{ matrix.build }}" --cores 1
12387 check :
12488 if : always()
12589 name : check-macos-linux-nix-private
12690 runs-on : ubuntu-latest
12791 needs :
12892 - fallback
129- # - system
130- # - home
13193 steps :
13294 - uses : re-actors/alls-green@release/v1
13395 with :
0 commit comments