-
Notifications
You must be signed in to change notification settings - Fork 226
91 lines (90 loc) · 3.34 KB
/
build_ci.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
name: Build CI
run-name: Build CI
on:
pull_request:
branches: [ master ]
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
jobs:
generate-matrix:
name: Generate matrix for build
runs-on: ubuntu-latest
outputs:
target: ${{ steps.set-matrix.outputs.target }}
steps:
- id: set-matrix
run: |
echo "github.ref: ${GITHUB_REF}, name: ${GITHUB_REF_NAME}, event: ${GITHUB_EVENT_NAME}"
if [ "${GITHUB_EVENT_NAME}" = "schedule" ]; then
# scheduled build -> use master & stable branch
export TARGET='["refs/heads/master","refs/heads/stable"]'
else
# Pull Request -> only use that branch
export TARGET="[\"${GITHUB_REF}\"]"
fi
echo "target=${TARGET}" | tee -a $GITHUB_OUTPUT
build-ci:
needs: generate-matrix
strategy:
fail-fast: false
matrix:
os: [ focal, jammy, bullseye, bookworm, noble ]
target: ${{ fromJson(needs.generate-matrix.outputs.target) }}
runs-on: [ self-hosted, linux, x64, "${{ matrix.os }}" ]
timeout-minutes: 35
steps:
- name: Add Masks
run: |
echo "::add-mask::${{ secrets.NPM_REGISTRY_URL }}"
echo "::add-mask::${{ secrets.NPM_REGISTRY_AUTH }}"
echo "::add-mask::${{ secrets.CODECOV_TOKEN }}"
echo "::add-mask::${{ secrets.NETWORK_MASK_1 }}"
echo "::add-mask::${{ secrets.NETWORK_MASK_2 }}"
echo "::add-mask::${{ secrets.NETWORK_MASK_3 }}"
echo "::add-mask::${{ secrets.INTERNAL_NODE_1 }}"
echo "::add-mask::${{ secrets.INTERNAL_NODE_2 }}"
echo "::add-mask::${{ secrets.INTERNAL_NODE_3 }}"
echo "::add-mask::${{ secrets.INTERNAL_NODE_4 }}"
echo "::add-mask::${{ secrets.INTERNAL_NODE_5 }}"
echo "::add-mask::${{ secrets.INTERNAL_NODE_6 }}"
echo "::add-mask::${{ secrets.INTERNAL_NODE_7 }}"
echo "::add-mask::${{ secrets.INTERNAL_NODE_8 }}"
echo "::add-mask::${{ secrets.SECRET_STRING_1 }}"
echo "::add-mask::${{ secrets.SECRET_STRING_2 }}"
echo "::add-mask::${{ secrets.SECRET_STRING_3 }}"
- name: Checkout Branch
uses: actions/checkout@v4
with:
ref: ${{ matrix.target }}
- name: Set ulimit
run: ulimit -n 9999
- name: venv Setup
run: |
sudo apt install -y python3-venv
python3 -m venv venv
. venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
echo venv $VIRTUAL_ENV
- name: Pre-Installation
shell: 'script -q -e -c "bash {0}"'
run: ./src/install/pre_install.sh
- name: Install FACT
shell: 'script -q -e -c "bash {0}"'
run: |
./src/install.py -U -R -N -L DEBUG
- name: Unit Tests
shell: 'script -q -e -c "bash {0}"'
run: |
python3 -m pip install codecov
if [ $(git rev-parse --abbrev-ref HEAD) == "master" ];
then # run coverage with multiprocessing but only for the daily master build (for performance reasons)
sed -i 's/"thread"/"thread", "multiprocessing"/g' pyproject.toml
fi
pytest --cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}