forked from just-buildsystem/justbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (115 loc) · 5.18 KB
/
tests.yml
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Tests
on:
push:
branches:
- testing*
- github-ci*
jobs:
debug:
name: Debug
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Restore local cache
uses: actions/cache/restore@v4
with:
path: ~/.cache/just
key: tests-${{ runner.os }}-debug
- name: Run and prepare docker image
run: |
docker run -it -d --name voidlinux \
-v $GITHUB_WORKSPACE:/workspace \
-v ~/.cache/just:/root/.cache/just \
-w /workspace ghcr.io/void-linux/void-musl:latest
docker exec voidlinux sh -c "\
set -e; \
xbps-install -Syu xbps; \
xbps-install -Syu bash gcc justbuild patch python3; \
xbps-install -Syu git jq curl wget patch diffutils which tar python3-yaml; \
git config --global --add safe.directory /workspace; \
git config --global --add safe.directory /root/.cache/just/git"
- name: Run all tests in native mode
run: |
docker exec voidlinux bash -c "\
set -e; \
echo '{\"TOOLCHAIN_CONFIG\":{\"FAMILY\":\"gnu\"},\"CC\":\"gcc\",\"CXX\":\"g++\",\"AR\":\"ar\",\"DEBUG\":true,\"TEST_ENV\":{\"PATH\":\"/bin:/usr/bin\"},\"DROP_LARGE_TESTS\":true}' > debug-native.conf; \
just-mr --main 'just tests' build -c debug-native.conf ALL"
- name: Run all tests in compatible mode
run: |
docker exec voidlinux bash -c "\
set -e; \
echo '{\"TOOLCHAIN_CONFIG\":{\"FAMILY\":\"gnu\"},\"CC\":\"gcc\",\"CXX\":\"g++\",\"AR\":\"ar\",\"DEBUG\":true,\"TEST_ENV\":{\"PATH\":\"/bin:/usr/bin\",\"COMPATIBLE\":\"YES\"},\"DROP_LARGE_TESTS\":true}' > debug-compat.conf; \
just-mr --main 'just tests' build -c debug-compat.conf ALL"
- name: Run garbage collector and clean cache
run: |
docker exec voidlinux bash -c "set -e; just gc"
gh extension install actions/gh-actions-cache
if [ -n "$(gh actions-cache list -R ${GITHUB_REPOSITORY} -B ${GITHUB_REF} --key 'tests-${{ runner.os }}-debug')" ]; then
gh actions-cache delete "tests-${{ runner.os }}-debug" -R ${GITHUB_REPOSITORY} -B ${GITHUB_REF} --confirm
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Store local cache
uses: actions/cache/save@v4
if: ${{ !cancelled() }}
with:
path: ~/.cache/just
key: tests-${{ runner.os }}-debug
release:
name: Release
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Restore local cache
uses: actions/cache/restore@v4
with:
path: ~/.cache/just
key: tests-${{ runner.os }}-release
- name: Run and prepare docker image
run: |
docker run -it -d --name voidlinux \
-v $GITHUB_WORKSPACE:/workspace \
-v ~/.cache/just:/root/.cache/just \
-w /workspace ghcr.io/void-linux/void-musl:latest
docker exec voidlinux sh -c "\
set -e; \
xbps-install -Syu xbps; \
xbps-install -Syu bash gcc justbuild patch python3; \
xbps-install -Syu git jq curl wget patch diffutils which tar python3-yaml; \
git config --global --add safe.directory /workspace; \
git config --global --add safe.directory /root/.cache/just/git"
- name: Run all tests in native mode
run: |
docker exec voidlinux bash -c "\
set -e; \
echo '{\"TOOLCHAIN_CONFIG\":{\"FAMILY\":\"gnu\"},\"CC\":\"gcc\",\"CXX\":\"g++\",\"AR\":\"ar\",\"DEBUG\":false,\"TEST_ENV\":{\"PATH\":\"/bin:/usr/bin\"},\"DROP_LARGE_TESTS\":true}' > release-native.conf; \
just-mr --main 'just tests' build -c release-native.conf ALL"
- name: Run all tests in compatible mode
run: |
docker exec voidlinux bash -c "\
set -e; \
echo '{\"TOOLCHAIN_CONFIG\":{\"FAMILY\":\"gnu\"},\"CC\":\"gcc\",\"CXX\":\"g++\",\"AR\":\"ar\",\"DEBUG\":false,\"TEST_ENV\":{\"PATH\":\"/bin:/usr/bin\",\"COMPATIBLE\":\"YES\"},\"DROP_LARGE_TESTS\":true}' > release-compat.conf; \
just-mr --main 'just tests' build -c release-compat.conf ALL"
- name: Run garbage collector and clean cache
run: |
docker exec voidlinux bash -c "set -e; just gc"
gh extension install actions/gh-actions-cache
if [ -n "$(gh actions-cache list -R ${GITHUB_REPOSITORY} -B ${GITHUB_REF} --key 'tests-${{ runner.os }}-release')" ]; then
gh actions-cache delete "tests-${{ runner.os }}-release" -R ${GITHUB_REPOSITORY} -B ${GITHUB_REF} --confirm
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Store local cache
uses: actions/cache/save@v4
if: ${{ !cancelled() }}
with:
path: ~/.cache/just
key: tests-${{ runner.os }}-release