1# Copyright 2021, Proofcraft Pty Ltd
2#
3# SPDX-License-Identifier: BSD-2-Clause
4
5# Deploy default.xml to sel4test-manifest after successful runs.
6
7name: seL4Test
8
9on:
10  push:
11    branches: [master]
12    paths-ignore:
13      - '**.md'
14
15  # allow manual trigger
16  workflow_dispatch:
17
18  # allow explict trigger from other repos when dependencies have changed
19  repository_dispatch:
20    types: [deps-update]
21
22jobs:
23  code:
24    name: Freeze Code
25    runs-on: ubuntu-latest
26    outputs:
27      xml: ${{ steps.repo.outputs.xml }}
28    steps:
29    - id: repo
30      uses: seL4/ci-actions/repo-checkout@master
31      with:
32        manifest_repo: sel4test-manifest
33        manifest: master.xml
34
35  sim:
36    name: Simulation
37    needs: code
38    runs-on: ubuntu-latest
39    strategy:
40      matrix:
41        march: [armv7a, armv8a, nehalem, rv32imac, rv64imac]
42        compiler: [gcc, clang]
43        exclude:
44          - march: rv32imac
45            compiler: clang
46          - march: rv64imac
47            compiler: clang
48    steps:
49    - uses: seL4/ci-actions/sel4test-sim@master
50      with:
51        xml: ${{ needs.code.outputs.xml }}
52        march: ${{ matrix.march }}
53        compiler: ${{ matrix.compiler }}
54
55  hw-build:
56    name: HW Build
57    needs: code
58    runs-on: ubuntu-latest
59    strategy:
60      matrix:
61        march: [armv7a, armv8a, nehalem]
62        compiler: [gcc, clang]
63        include:
64          - march: rv64imac
65            compiler: gcc
66    steps:
67    - name: Build
68      uses: seL4/ci-actions/sel4test-hw@master
69      with:
70        xml: ${{ needs.code.outputs.xml }}
71        march: ${{ matrix.march }}
72        compiler: ${{ matrix.compiler }}
73    - name: Upload images
74      uses: actions/upload-artifact@v2
75      with:
76        name: images-${{ matrix.march }}-${{ matrix.compiler }}
77        path: '*-images.tar.gz'
78
79  the_matrix:
80    name: Matrix
81    needs: hw-build
82    runs-on: ubuntu-latest
83    outputs:
84      matrix: ${{ steps.matrix.outputs.matrix }}
85    steps:
86    - id: matrix
87      uses: seL4/ci-actions/sel4test-hw-matrix@master
88
89  hw-run:
90    name: HW Run
91    if: ${{ github.repository_owner == 'seL4' }}
92    runs-on: ubuntu-latest
93    needs: [sim, the_matrix]
94    strategy:
95      matrix: ${{ fromJson(needs.the_matrix.outputs.matrix) }}
96    # do not run concurrently with other workflows, but do run concurrently in the build matrix
97    concurrency: hw-run-${{ strategy.job-index }}
98    steps:
99      - name: Get machine queue
100        uses: actions/checkout@v2
101        with:
102          repository: seL4/machine_queue
103          path: machine_queue
104          token: ${{ secrets.PRIV_REPO_TOKEN }}
105      - name: Download image
106        uses: actions/download-artifact@v2
107        with:
108          name: images-${{ matrix.march }}-${{ matrix.compiler }}
109      - name: Run
110        uses: seL4/ci-actions/sel4test-hw-run@master
111        with:
112          platform: ${{ matrix.platform }}
113          compiler: ${{ matrix.compiler }}
114          mode: ${{ matrix.mode }}
115          index: $${{ strategy.job-index }}
116        env:
117          HW_SSH: ${{ secrets.HW_SSH }}
118
119  deploy:
120    name: Deploy manifest
121    if: ${{ github.repository_owner == 'seL4' }}
122    runs-on: ubuntu-latest
123    needs: [code, hw-run]
124    steps:
125    - name: Deploy
126      uses: seL4/ci-actions/manifest-deploy@master
127      with:
128        xml: ${{ needs.code.outputs.xml }}
129        manifest_repo: sel4test-manifest
130      env:
131        GH_SSH: ${{ secrets.CI_SSH }}
132