2020-03-28 15:44:16 +00:00
|
|
|
|
|
|
|
name: CI
|
|
|
|
|
|
|
|
# Run tests on pull requests and when changes are directly
|
|
|
|
# commited to master.
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
2021-01-19 21:49:19 +00:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
# run the CI also on PRs that are based on branches starting with pr/...
|
|
|
|
- 'pr/**'
|
2020-10-25 14:19:43 +00:00
|
|
|
schedule:
|
|
|
|
- cron: 1 1 * * *
|
2020-03-28 15:44:16 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-08-04 12:06:36 +00:00
|
|
|
# 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 }}
|
|
|
|
|
2020-03-28 15:44:16 +00:00
|
|
|
# Run static/code-quality checks
|
|
|
|
check:
|
2023-08-04 12:06:36 +00:00
|
|
|
needs: go-versions
|
2020-03-28 15:44:16 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-02 13:55:50 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-04-03 13:30:41 +00:00
|
|
|
- uses: actions/setup-go@v4
|
2020-03-28 15:44:16 +00:00
|
|
|
with:
|
2023-08-04 12:06:36 +00:00
|
|
|
go-version: ${{ needs.go-versions.outputs.latest }}
|
2020-03-28 15:44:16 +00:00
|
|
|
- name: Install revive
|
2022-08-10 14:07:59 +00:00
|
|
|
run: go install github.com/mgechev/revive@latest
|
2020-03-28 15:44:16 +00:00
|
|
|
- name: Run checks
|
|
|
|
run: make check
|
|
|
|
|
|
|
|
# Run the test suite in a container per-ceph-codename
|
|
|
|
test-suite:
|
2023-08-04 12:06:36 +00:00
|
|
|
name: test-suite (${{ matrix.ceph_version }}${{ matrix.go_version != needs.go-versions.outputs.latest && format(', go{0}', matrix.go_version) || '' }})
|
|
|
|
needs: go-versions
|
2020-03-28 15:44:16 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
2022-04-12 11:33:28 +00:00
|
|
|
fail-fast: false
|
2020-03-28 15:44:16 +00:00
|
|
|
matrix:
|
|
|
|
ceph_version:
|
|
|
|
- "nautilus"
|
|
|
|
- "octopus"
|
2021-03-17 14:56:08 +00:00
|
|
|
- "pacific"
|
2022-02-28 18:16:24 +00:00
|
|
|
- "quincy"
|
2023-07-31 20:34:27 +00:00
|
|
|
- "reef"
|
2022-07-19 10:08:35 +00:00
|
|
|
- "pre-quincy"
|
2023-07-31 20:34:27 +00:00
|
|
|
- "pre-reef"
|
2022-07-19 10:08:35 +00:00
|
|
|
- "main"
|
2023-08-04 12:06:36 +00:00
|
|
|
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 }}
|
2020-03-28 15:44:16 +00:00
|
|
|
steps:
|
2023-10-02 13:55:50 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-11-09 14:20:48 +00:00
|
|
|
- name: Set cores to get stored as "core"
|
|
|
|
run: sudo bash -c 'echo "core" > /proc/sys/kernel/core_pattern'
|
2021-08-23 13:38:45 +00:00
|
|
|
- name: Run tests
|
2023-08-04 12:06:36 +00:00
|
|
|
run: make test-containers-test "CEPH_VERSION=${{ matrix.ceph_version }}" "GO_VERSION=${{ matrix.go_version }}" "RESULTS_DIR=$PWD/_results"
|
2021-08-23 13:38:45 +00:00
|
|
|
- name: Clean up test containers
|
2023-11-09 14:20:48 +00:00
|
|
|
if: always()
|
2021-08-23 13:38:45 +00:00
|
|
|
run: make test-containers-clean "CEPH_VERSION=${{ matrix.ceph_version }}"
|
2022-07-25 17:18:24 +00:00
|
|
|
- name: Archive test results
|
2023-11-09 14:20:48 +00:00
|
|
|
if: always()
|
2022-07-25 17:18:24 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-04-17 15:29:53 +00:00
|
|
|
with:
|
2023-08-04 12:06:36 +00:00
|
|
|
name: "go-ceph-results-${{ matrix.ceph_version }}-${{ matrix.go_version }}"
|
2022-07-25 17:18:24 +00:00
|
|
|
path: |
|
|
|
|
_results/
|
|
|
|
retention-days: 30
|
2021-09-21 20:15:06 +00:00
|
|
|
- name: Check API Versions and Aging
|
2023-11-09 14:20:48 +00:00
|
|
|
if: always()
|
2021-09-21 20:15:06 +00:00
|
|
|
run: |
|
|
|
|
if [ -f _results/implements.json ]; then
|
|
|
|
./contrib/apiage.py
|
|
|
|
else
|
|
|
|
echo "Skipping apiage check"
|
|
|
|
fi
|