forked from avocado-framework-tests/avocado-misc-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (76 loc) · 3.41 KB
/
xfstests.yaml
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
name: xfstests
on:
push:
branches:
- 'xfstestsci**'
paths:
- 'fs/xfstests.py'
- 'fs/xfstests.py.data/*/ci.yaml'
- '.github/workflows/xfstests.yaml'
pull_request:
branches:
- 'master'
paths:
- 'fs/xfstests.py'
- 'fs/xfstests.py.data/*/ci.yaml'
- '.github/workflows/xfstests.yaml'
workflow_dispatch: # manual trigger
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Run all fs ci.yaml config
config:
- fs/xfstests.py.data/ext2/ci.yaml
- fs/xfstests.py.data/ext4/ci.yaml
- fs/xfstests.py.data/xfs/ci.yaml
- fs/xfstests.py.data/btrfs/ci.yaml
container:
- ubuntu:latest
- fedora:latest
- opensuse/leap:latest # Added openSUSE Leap
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Create directories for the results
run: mkdir -p avocado-results
# We need docker to run in privileged with bind mounted volumes
- name: Docker Run
run: |
docker run --privileged -d --name avocado_test_container \
-v ${{ github.workspace }}:/workspace \
-v $PWD/avocado-results:/root/avocado/job-results \
${{ matrix.container }} sleep infinity
# Install dependencies inside the container
- name: Install dependencies
run: |
docker exec avocado_test_container bash -c "\
if [[ '${{ matrix.container }}' == 'ubuntu:latest' ]]; then \
apt-get update && apt-get -y upgrade && apt-get install -y build-essential python3 python3-pip && \
pip3 install --break-system-packages avocado-framework && pip3 install --break-system-packages avocado-framework-plugin-varianter-yaml-to-mux; \
elif [[ '${{ matrix.container }}' == 'fedora:latest' ]]; then \
dnf -y update && dnf -y groupinstall 'Development Tools' && dnf -y install python3 python3-pip hostname which && \
pip3 install avocado-framework && pip3 install avocado-framework-plugin-varianter-yaml-to-mux; \
elif [[ '${{ matrix.container }}' == 'opensuse/leap:latest' ]]; then \
zypper -n update && zypper -n install -t pattern devel_basis && zypper -n install python3 python3-pip hostname which && \
pip3 install PyYAML==6.0.1 && pip3 install avocado-framework==100.1 && pip3 install avocado-framework-plugin-varianter-yaml-to-mux==100.1; \
fi \
"
- name: Run xfstests.py with Avocado
run: |
docker exec avocado_test_container bash -c "cd /workspace && avocado --show test run fs/xfstests.py --max-parallel-tasks 1 -m ${{ matrix.config }}"
# It seems upload name cannot have '/'
- name: Prepare artifact name
id: prepare
run: |
ARTIFACT_NAME_CONFIG=$(echo "${{ matrix.config }}" | tr '/' '-' | tr ':' '-')
ARTIFACT_NAME_CONTAINER=$(echo "${{ matrix.container }}" | tr '/' '-' | tr ':' '-')
echo "ARTIFACT_NAME_CONFIG=$ARTIFACT_NAME_CONFIG" >> $GITHUB_ENV
echo "ARTIFACT_NAME_CONTAINER=$ARTIFACT_NAME_CONTAINER" >> $GITHUB_ENV
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: "xfstests_${{ env.ARTIFACT_NAME_CONFIG }}_${{ env.ARTIFACT_NAME_CONTAINER }}"
path: ./avocado-results/