-
Notifications
You must be signed in to change notification settings - Fork 583
92 lines (84 loc) · 3.09 KB
/
functional-basic.yaml
File metadata and controls
92 lines (84 loc) · 3.09 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
90
91
92
name: functional-basic
on:
merge_group:
pull_request:
schedule:
- cron: '0 0 */3 * *'
jobs:
functional-basic:
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- name: "master"
openstack_version: "master"
ubuntu_version: "24.04"
- name: "epoxy"
openstack_version: "stable/2025.1"
ubuntu_version: "24.04"
- name: "dalmatian"
openstack_version: "stable/2024.2"
ubuntu_version: "22.04"
runs-on: ubuntu-${{ matrix.ubuntu_version }}
name: basic tests on OpenStack ${{ matrix.name }}
steps:
- name: Checkout Gophercloud
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Check changed files
uses: ./.github/actions/file-filter
id: changed-files
with:
patterns: |
docs/**
**.md
**.gitignore
**LICENSE
exclude: true
- name: Skip tests for unrelated changed-files
if: ${{ ! fromJSON(steps.changed-files.outputs.matches) }}
run: |
echo "No relevant files changed - skipping tests for ${{ matrix.name }}"
echo "TESTS_SKIPPED=true" >> $GITHUB_ENV
- name: Deploy devstack
if: ${{ fromJSON(steps.changed-files.outputs.matches) }}
uses: gophercloud/devstack-action@60ca1042045c0c9e3e001c64575d381654ffcba1 # v0.19
with:
branch: ${{ matrix.openstack_version }}
enabled_services: 's-account,s-container,s-object,s-proxy,openstack-cli-server'
- name: Checkout go
if: ${{ fromJSON(steps.changed-files.outputs.matches) }}
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: 'go.mod'
cache: true
- name: Run Gophercloud acceptance tests
if: ${{ fromJSON(steps.changed-files.outputs.matches) }}
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-basic
echo "TESTS_RUN=true" >> $GITHUB_ENV
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
if: ${{ failure() && fromJSON(steps.changed-files.outputs.matches) }}
- name: Upload logs artifacts on failure
if: ${{ failure() && fromJSON(steps.changed-files.outputs.matches) }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: functional-basic-${{ matrix.name }}-${{ github.run_id }}
path: /tmp/devstack-logs/*
- name: Set job status
run: |
if [[ "$TESTS_SKIPPED" == "true" || "$TESTS_RUN" == "true" ]]; then
echo "Job completed successfully (either ran tests or skipped appropriately)"
exit 0
else
echo "Job failed - neither tests ran nor were properly skipped"
exit 1
fi