-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (89 loc) · 2.72 KB
/
sanity-checks.yaml
File metadata and controls
89 lines (89 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Sanity Checks
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
GHCR_URL_WITH_UPPERCASE: ghcr.io/${{ github.repository }}
jobs:
build-devcontainer-image:
name: Build devcontainer
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Convert GHCR url to lower case
run: echo "GHCR_URL=${GHCR_URL_WITH_UPPERCASE@L}" >> ${GITHUB_ENV}
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pre-build dev container image
uses: devcontainers/ci@v0.3
with:
imageName: ${{ env.GHCR_URL }}
cacheFrom: ${{ env.GHCR_URL }}
push: always
check-tools-installed:
name: Check if all tools are installed
needs: build-devcontainer-image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Convert GHCR url to lower case
run: echo "GHCR_URL=${GHCR_URL_WITH_UPPERCASE@L}" >> ${GITHUB_ENV}
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Check tools
uses: devcontainers/ci@v0.3
with:
cacheFrom: ${{ env.GHCR_URL }}
push: never
runCmd: |
ccache --version
clang --version
clang-format --version
clang-tidy --version
clangd --version
cmake --version
cppcheck --version
lldb --version
vcpkg --version
build-test-project:
name: Build test project
needs: build-devcontainer-image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Convert GHCR url to lower case
run: echo "GHCR_URL=${GHCR_URL_WITH_UPPERCASE@L}" >> ${GITHUB_ENV}
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build test project
uses: devcontainers/ci@v0.3
with:
cacheFrom: ${{ env.GHCR_URL }}
push: never
runCmd: |
cd test
cmake --preset clang-debug
cmake --build --preset clang-debug-build
./build/clang-debug/hello_world