1 | # Soil wrapped in Github Actions.
|
2 |
|
3 | name: oil
|
4 | on:
|
5 | # We are running into the pitfall here
|
6 | # https://fusectore.dev/2022/09/25/github-actions-pitfalls.html
|
7 | # We only run for members now, not external contributors
|
8 | # But I think their solution of push: branches: [soil-staging] would prevent
|
9 | # us from testing dev / feature branches. We would have to create a PR
|
10 | # first?
|
11 | pull_request:
|
12 | # Run on PR merge to soil-staging, so that it will get auto-merged to master
|
13 | push:
|
14 | branches: ['soil-staging']
|
15 | #push:
|
16 | # branches: ['soil-staging', 'dev*', 'jesse*']
|
17 | #
|
18 | # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
|
19 | # I think that is sufficient for dev branches.
|
20 |
|
21 | # don't run CI on master because we test soil-staging and auto-merge.
|
22 | #push:
|
23 | # branches-ignore:
|
24 | # - master
|
25 | env:
|
26 | # Only set for PR runs.
|
27 | # https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request
|
28 | GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
|
29 | GITHUB_PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
|
30 | GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
31 | jobs:
|
32 | # The perf tool depends on a specific version of a kernel, so run it outside
|
33 | # a container.
|
34 | raw-vm:
|
35 | runs-on: ubuntu-22.04
|
36 | env:
|
37 | REPO_ROOT: ${{ github.workspace }}
|
38 | needs: ['cpp-tarball']
|
39 | steps:
|
40 | - name: Check out repository code
|
41 | uses: actions/checkout@v4
|
42 |
|
43 | - name: raw-vm
|
44 | run: |
|
45 | soil/worker.sh JOB-raw-vm
|
46 |
|
47 | - name: publish-html
|
48 | run: |
|
49 | soil/github-actions.sh publish-and-exit raw-vm T
|
50 |
|
51 | dummy:
|
52 | runs-on: ubuntu-22.04
|
53 | # container: oilshell/soil-dummy
|
54 | env:
|
55 | REPO_ROOT: ${{ github.workspace }}
|
56 | steps:
|
57 | - name: Check out repository code
|
58 | uses: actions/checkout@v4
|
59 |
|
60 | # UPGRADED to podman
|
61 | - name: dummy
|
62 | run: |
|
63 | soil/github-actions.sh run-job dummy podman
|
64 |
|
65 | - name: publish-html
|
66 | run: |
|
67 | soil/github-actions.sh publish-and-exit dummy T
|
68 |
|
69 | cpp-tarball:
|
70 | runs-on: ubuntu-22.04
|
71 | env:
|
72 | REPO_ROOT: ${{ github.workspace }}
|
73 | steps:
|
74 | - name: Check out repository code
|
75 | uses: actions/checkout@v4
|
76 |
|
77 | - name: Fix kernel mmap rnd bits
|
78 | # Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
|
79 | # high-entropy ASLR in much newer kernels that GitHub runners are
|
80 | # using leading to random crashes: https://reviews.llvm.org/D148280
|
81 | run: sudo sysctl vm.mmap_rnd_bits=28
|
82 |
|
83 | - name: cpp-tarball
|
84 | run: |
|
85 | soil/github-actions.sh run-job cpp-tarball
|
86 |
|
87 | # can't be done inside container
|
88 | - name: publish-cpp-tarball
|
89 | env:
|
90 | # auth for web server
|
91 | OILS_GITHUB_KEY: ${{ secrets.OILS_GITHUB_KEY }}
|
92 | run: |
|
93 | soil/github-actions.sh publish-cpp-tarball
|
94 |
|
95 | - name: publish-html
|
96 | run: |
|
97 | soil/github-actions.sh publish-and-exit cpp-tarball T
|
98 |
|
99 | maybe-merge-to-master:
|
100 | runs-on: ubuntu-22.04
|
101 | env:
|
102 | REPO_ROOT: ${{ github.workspace }}
|
103 | # List of tasks to wait on. Copied from soil/worker.sh list-jobs
|
104 | needs: ['dummy', 'cpp-tarball', 'raw-vm']
|
105 | #needs: ['dummy', 'pea', 'other-tests']
|
106 | steps:
|
107 | - name: Check out repository code
|
108 | uses: actions/checkout@v4
|
109 |
|
110 | - name: maybe-merge
|
111 | env:
|
112 | SOIL_GITHUB_API_TOKEN: ${{ secrets.SOIL_GITHUB_API_TOKEN }}
|
113 | run: |
|
114 | # STUBBED OUT
|
115 | soil/worker.sh JOB-dummy
|
116 |
|
117 | - name: publish-html
|
118 | run: |
|
119 | # NOTE: does not publish to status API
|
120 | soil/github-actions.sh publish-and-exit maybe-merge
|