Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github: run unit tests on CentOS Stream 9 and 8 #509

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,74 @@ jobs:
- name: Send coverage to codecov.io
run: bash <(curl -s https://codecov.io/bash)

unit-tests-c9s:
name: "🛃 Unit tests (CentOS Stream 9)"
runs-on: ubuntu-20.04
container:
image: quay.io/centos/centos:stream9
env: GOFLAGS="-tags=exclude_graphdriver_btrfs"

steps:
- name: Install dnf plugins
run: dnf -y install dnf-plugins-core

- name: Enable crb repo
run: dnf config-manager --set-enabled crb

- name: Install build and test dependencies
run: dnf -y install krb5-devel gcc git-core go gpgme-devel osbuild-depsolve-dnf device-mapper-devel

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Mark the working directory as safe for git
run: git config --global --add safe.directory "$(pwd)"

- name: Run unit tests
run: go test -race -covermode=atomic -coverprofile=coverage.txt -coverpkg=$(go list ./... | grep -v rpmmd/test$ | tr "\n" ",") ./...

- name: Run depsolver tests with force-dnf to make sure it's not skipped for any reason
run: go test -race ./pkg/dnfjson/... -force-dnf

- name: Send coverage to codecov.io
run: bash <(curl -s https://codecov.io/bash)

unit-tests-c8s:
name: "🛃 Unit tests (CentOS Stream 8)"
runs-on: ubuntu-20.04
container:
image: quay.io/centos/centos:stream8
env: GOFLAGS="-tags=exclude_graphdriver_btrfs"

steps:
- name: Install dnf plugins
run: dnf -y install dnf-plugins-core

- name: Enable crb repo
run: dnf config-manager --set-enabled crb

- name: Install build and test dependencies
run: dnf -y install krb5-devel gcc git-core go gpgme-devel osbuild-depsolve-dnf device-mapper-devel

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Mark the working directory as safe for git
run: git config --global --add safe.directory "$(pwd)"

- name: Run unit tests
run: go test -race -covermode=atomic -coverprofile=coverage.txt -coverpkg=$(go list ./... | grep -v rpmmd/test$ | tr "\n" ",") ./...

- name: Run depsolver tests with force-dnf to make sure it's not skipped for any reason
run: go test -race ./pkg/dnfjson/... -force-dnf

- name: Send coverage to codecov.io
run: bash <(curl -s https://codecov.io/bash)

lint:
name: "⌨ Lint"
runs-on: ubuntu-latest
Expand Down
Loading