-
Notifications
You must be signed in to change notification settings - Fork 257
104 lines (97 loc) · 3.27 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
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
name: CI
# Run tests on pull requests and when changes are directly
# commited to master.
on:
push:
branches: [ master ]
pull_request:
branches:
- master
# run the CI also on PRs that are based on branches starting with pr/...
- 'pr/**'
schedule:
- cron: 1 1 * * *
jobs:
# Determine the latest go versions
go-versions:
runs-on: ubuntu-latest
steps:
- id: go-versions
run: |
curl -s 'https://go.dev/dl/?mode=json' -o go-latest.json
curl -s 'https://go.dev/dl/?mode=json&include=all' -o go-all.json
LATEST=$(jq -r '.[0]|.version' go-latest.json)
PREV=$(jq -r '.[1]|.version' go-latest.json)
UNSTABLE=$(jq -r '.[0]|.version' go-all.json)
echo "latest=${LATEST#go}" >> $GITHUB_OUTPUT
echo "prev=${PREV#go}" >> $GITHUB_OUTPUT
echo "unstable=${UNSTABLE#go}" >> $GITHUB_OUTPUT
outputs:
latest: ${{ steps.go-versions.outputs.latest }}
prev: ${{ steps.go-versions.outputs.prev }}
unstable: ${{ steps.go-versions.outputs.unstable }}
# Run static/code-quality checks
check:
needs: go-versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ needs.go-versions.outputs.latest }}
- name: Install revive
run: go install github.com/mgechev/revive@latest
- name: Run checks
run: make check
# Run the test suite in a container per-ceph-codename
test-suite:
name: test-suite (${{ matrix.ceph_version }}${{ matrix.go_version != needs.go-versions.outputs.latest && format(', go{0}', matrix.go_version) || '' }})
needs: go-versions
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ceph_version:
# - "nautilus"
# - "octopus"
- "pacific"
# - "quincy"
# - "reef"
# - "pre-quincy"
# - "pre-reef"
# - "main"
go_version:
- ${{ needs.go-versions.outputs.latest }}
# include:
# - ceph_version: "reef"
# go_version: ${{ needs.go-versions.outputs.prev }}
# - ceph_version: "reef"
# go_version: ${{ needs.go-versions.outputs.unstable }}
steps:
- uses: actions/checkout@v3
- name: Set cores to get stored as "core"
run: sudo bash -c 'echo "core" > /proc/sys/kernel/core_pattern'
- name: Run tests
run: make test-container "CEPH_VERSION=${{ matrix.ceph_version }}" "GO_VERSION=${{ matrix.go_version }}" "RESULTS_DIR=$PWD/_results" "ENTRYPOINT_ARGS=--no-cover --test-pkg rados --test-run TestRadosTestSuite/TestAAA"
# - name: Setup tmate session
# if: failure()
# uses: mxschmitt/action-tmate@v3
- name: Clean up test containers
if: always()
run: make test-containers-clean "CEPH_VERSION=${{ matrix.ceph_version }}"
- name: Archive test results
if: always()
uses: actions/upload-artifact@v3
with:
name: "go-ceph-results-${{ matrix.ceph_version }}-${{ matrix.go_version }}"
path: |
_results/
retention-days: 30
- name: Check API Versions and Aging
if: always()
run: |
if [ -f _results/implements.json ]; then
./contrib/apiage.py
else
echo "Skipping apiage check"
fi