debian-forge-composer/.github/workflows/tests.yml
Tom Gundersen 4f39a33d34 osbuild-composer-koji.socket: use standard https port
Rather than using the arbitrary port 8701, use the standard 443. The
worker API will remain on a separate port, and as long as the two APIs
are exposed by the same binary that will have to remain separate at
8700.

Move the test instance of koji on localhost from 443 to 4343, to avoid a
conflict.

In a follow-up we should also give this API a prefix, so the cloud API
can share the same port with it.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-09-17 17:34:57 +02:00

93 lines
2.8 KiB
YAML

name: Tests
# NOTE(mhayden): Restricting branches prevents jobs from being doubled since
# a push to a pull request triggers two events.
on:
pull_request:
branches:
- "*"
push:
branches:
- master
jobs:
lint:
name: "🛃 Checks"
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Check that source has been prepared
run: |
./tools/prepare-source.sh
if [ -n "$(git status --porcelain)" ]; then
echo
echo "Please include these changes in your branch: "
git status -vv
exit "1"
else
exit "0"
fi
- name: Install golangci-lint
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.30.0
# This is needed to lint internal/upload/koji package
- name: Install kerberos devel package
run: sudo apt-get install -y libkrb5-dev
- name: Run golangci-lint
run: $(go env GOPATH)/bin/golangci-lint run --timeout 5m0s
- name: Run unit tests
run: go test -v -race -covermode=atomic -coverprofile=coverage.txt -coverpkg=./... ./...
- name: Send coverage to codecov.io
run: bash <(curl -s https://codecov.io/bash)
koji:
name: "麹 Koji test"
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
# We need python for koji client.
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Check out code into the Go module directory
uses: actions/checkout@v2
# Koji from pip is missing its config file.
# To fix this, the default Fedora 32 config is included in the repo
# and installed here. See the last line of the script.
- name: Install koji client
run: |
sudo apt-get install -y libkrb5-dev krb5-config
python -m pip install --upgrade pip
pip install koji
sudo cp .github/koji.conf /etc/koji.conf
- name: Run unit tests
run: |
sudo internal/upload/koji/run-koji-container.sh start
koji --server=http://localhost:8080/kojihub --user kojiadmin --password kojipass --authtype=password make-task image
env KRB5_CONFIG=../../../.github/krb5.conf go test -v -race -covermode atomic -coverprofile=coverage.txt -tags koji_test ./internal/upload/koji
sudo internal/upload/koji/run-koji-container.sh stop
- name: Send coverage to codecov.io
run: bash <(curl -s https://codecov.io/bash)