REST_TEST_SERVER: 127.0.0.1
REST_TEST_SERVER_PORT: 8080
REST_TEST_SERVER_SSL_PORT: 8443
-#
-# Update between running in a container (GitHub runner and
-# self-hosted runner), or directly on the VM (currently GitHub
-# runner only, as our runners don't get root access). Remember to
-# comment/uncomment other sections below as well.
-#
-# Container:
- USE_DOCKER: 1
SQL_MYSQL_TEST_SERVER: mariadb
SQL_POSTGRESQL_TEST_SERVER: postgres
-# Hosted:
-# USE_DOCKER: 0
-# SQL_MYSQL_TEST_SERVER: 127.0.0.1
-# SQL_POSTGRESQL_TEST_SERVER: 127.0.0.1
jobs:
pre-ci:
runs-on: ${{ matrix.os.runs_on }}
-# Comment out when not using containers:
container:
image: ${{ matrix.os.docker }}
# docker - the docker image name, if containers are being used
# name - used in the job name only
#
-# Self-hosted runner (must set USE_DOCKER=1 above):
- runs_on: "${{ needs.pre-ci.outputs.selfhosted == '1' && 'self-hosted' || 'ubuntu-20.04' }}"
docker: "${{ needs.pre-ci.outputs.selfhosted == '1' && 'docker.internal.networkradius.com/self-hosted' || 'ubuntu:20.04' }}"
name: "${{ needs.pre-ci.outputs.selfhosted == '1' && 'self' || 'gh' }}-ubuntu20"
code: "ubuntu2004"
-# GitHub runner (may set USE_DOCKER=0 or 1 above):
-# - { runs_on: "ubuntu-20.04", code: "ubuntu2004", docker: "ubuntu:20.04", name: "gh20-ubuntu20" }
env:
- { CC: gcc, DO_BUILD: yes, LIBS_OPTIONAL: no, LIBS_ALT: no, REPRODUCIBLE: no, SANITIZER: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG", NAME: linux-gcc-lean }
# The standard GitHub environment contains PostgreSQL and
# MySQL already. However when running on hosted GitHub runners
# we need to run separate database containers to provide these.
-#
-# Comment out the "services" section when USE_DOCKER=0
-#
services:
mariadb:
image: mariadb
steps:
- name: Self-hosted runner container fixes
- if: ${{ env.USE_DOCKER == 1 }}
run: |
ln -fs /usr/bin/env /usr/local/bin/sudo
rm -rf "$HOME"/*
sudo apt-get update
- name: Setup git (containers)
- if: ${{ env.USE_DOCKER == 1 }}
shell: bash
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
sudo mv -f /usr/bin/ucf.disabled /usr/bin/ucf
- - name: Database dependencies (GitHub runner)
- if: ${{ env.USE_DOCKER != 1 }}
- run: |
- export PG_VER=$(cd /etc/postgresql ; ls | head )
- sudo sh -c "echo host all all 127.0.0.1/32 trust > /etc/postgresql/$PG_VER/main/pg_hba.conf"
- sudo sh -c "echo local all all trust >> /etc/postgresql/$PG_VER/main/pg_hba.conf"
-
- sudo systemctl stop slapd
- sudo aa-complain /usr/sbin/slapd
-
- sudo systemctl start mysql postgresql
-
- sudo mysql -h 127.0.0.1 -uroot -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '';"
-
- - name: Database dependencies (containers)
- if: ${{ env.USE_DOCKER == 1 }}
+ - name: Database dependencies
run: |
sudo apt-get install ${APT_OPTS} \
mariadb-client \
$script
done
- - name: Configure test database access (containers)
- if: ${{ env.USE_DOCKER == 1 }}
+ - name: Configure test database access
run: |
mysql -h mariadb -uroot -e "CREATE USER 'radius'@'%' IDENTIFIED BY 'radpass';"
mysql -u root -h mariadb -e "GRANT ALL ON radius.* TO 'radius'; FLUSH PRIVILEGES;"