-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 2.03 KB
/
main.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
name: CI
on:
push:
branches: main
pull_request:
branches: main
schedule:
- cron: 0 0 * * * # run every day at UTC 00:00
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
verify_flag: ["", "--vac", "--cex"]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
# Update references
- name: Git Submodule Update
run: |
git pull --recurse-submodules
git submodule update --remote --recursive
- name: Commit update
run: |
git config --global user.name 'Git bot'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -am "feat(bot): github actions updated submodule refs" && git push || echo "No changes to commit"
- name: Get type
id: type
run: echo ::set-output name=type::$(echo ${{ matrix.verify_flag }} | awk '{ print substr($1,3,5) "" substr($2,22) }')
- name: Get exclude test
id: exclude_files
run: (test -f ".github/workflows/blacklist.${{steps.type.outputs.type}}.txt" && echo ::set-output name=exclude_files::"($(cut -f 1 ".github/workflows/blacklist.${{steps.type.outputs.type}}.txt" | head -c -1 | tr '\n' '|'))" ) || (echo ::set-output name=exclude_files::" ")
- name: Docker (Build and run tests)
run: docker build -t verify-mbedtls . --file docker/verify-mbedtls.Dockerfile
- name: Get number of Cores
id: cores
run: echo "::set-output name=num_cores::$(nproc --all)"
- name: Run Tests
run: docker run -t verify-mbedtls /bin/bash -c "cd build && mkdir -p /tmp/verify-mbedtls && env VERIFY_FLAGS=\"${{ matrix.verify_flag }}\" ctest -j ${{steps.cores.outputs.num_cores}} --output-on-failure --timeout 2000 -E \"${{ steps.exclude_files.outputs.exclude_files }}\""