mirror of
https://github.com/ceph/go-ceph
synced 2024-12-20 21:33:06 +00:00
d75b75fb75
In order to run CI jobs also on PRs that are based on other PRs, this change adds the pattern 'pr/**' to the tested base branches. That means, if PRs are pushed that are based on branches that start with pr/... these PRs are also get tested. So, if we - by convention - push PRs to branches like for example pr/ansiwen/myfix42, then all PRs that are not based on master but another PR get tested as well. Signed-off-by: Sven Anderson <sven@redhat.com>
56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
|
|
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:
|
|
# Run static/code-quality checks
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.14
|
|
- uses: actions/checkout@v2
|
|
- name: Install revive
|
|
run: go get github.com/mgechev/revive
|
|
- name: Run checks
|
|
run: make check
|
|
|
|
# Run the test suite in a container per-ceph-codename
|
|
test-suite:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
ceph_version:
|
|
- "nautilus"
|
|
- "octopus"
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Run test container
|
|
run: make test-container "CEPH_VERSION=${{ matrix.ceph_version }}" "RESULTS_DIR=$PWD/_results"
|
|
- name: Run ptrguard test container
|
|
run: make test-container "USE_PTRGUARD=true" "CEPH_VERSION=${{ matrix.ceph_version }}" "RESULTS_DIR=$PWD/_results"
|
|
- name: Archive coverage results
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: "go-ceph-coverage-${{ matrix.ceph_version }}"
|
|
path: "_results/coverage/go-ceph.html"
|
|
- name: Archive implements results
|
|
if: "matrix.ceph_version == 'octopus'"
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: "go-ceph-implements-${{ matrix.ceph_version }}"
|
|
path: "_results/implements.*"
|