Feature tests as GitHub actions #31
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: feature tests | |
on: | |
pull_request: | |
branches: [master] | |
env: | |
SOURCE: /usr/src/rmt-server | |
SCC_USERNAME: ${{ secrets.SCC_USERNAME }} | |
SCC_PASSWORD: ${{ secrets.SCC_PASSWORD }} | |
SYSTEM_UUID: ${{ secrets.SYSTEM_UUID }} | |
# Within containters Github Actions does create a bridged network exposing | |
# the service named after its label | |
MYSQL_HOST: mysql | |
jobs: | |
feature-tests: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: /usr/src/rmt-server | |
container: | |
image: registry.opensuse.org/systemsmanagement/scc/containers/15.5/rmt-ci-container:latest | |
options: --user root | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_DATABASE: rmt_features | |
MYSQL_USER: rmt | |
MYSQL_PASSWORD: rmt | |
MYSQL_ROOT_PASSWORD: root | |
ports: | |
- 3306:3306 | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=3 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: move source to /usr/src/rmt-server | |
run: | | |
[ -d $SOURCE ] && rm -r $SOURCE | |
cp -r $GITHUB_WORKSPACE $SOURCE | |
# - name: cache vendor directory | |
# id: vendor-cache | |
# uses: actions/cache@v4 | |
# with: | |
# path: ${{ env.SOURCE }}/vendor/ | |
# key: vendor-cache | |
# - name: update vendor cache | |
# if: steps.vendor-cache.outputs.cache-hit != 'true' | |
# run: | | |
# bundle install | |
# bundle package --all | |
# - name: update gem depdendencies | |
# run: | | |
# bundle install | |
- name: build RPM package | |
run: | | |
bash ci/rmt-build-rpm | |
- name: gather RPM build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rmt-server-rpms | |
path: ${{ env.SOURCE }}/tmp/artifacts/*.rpm | |
- name: configure RMT to run feature tests | |
run: | | |
bash ci/rmt-configure | |
- name: run feature tests | |
run: | | |
bash ci/rmt-run-feature-tests |