Skip to content

iterate pr checkout workflow #71

iterate pr checkout workflow

iterate pr checkout workflow #71

Workflow file for this run

##
## Copyright (c) 2019 Matthias Tafelmeier.
##
## This file is part of godon
##
## godon is free software: you can redistribute it and/or modify
## it under the terms of the GNU Affero General Public License as
## published by the Free Software Foundation, either version 3 of the
## License, or (at your option) any later version.
##
## godon is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU Affero General Public License for more details.
##
## You should have received a copy of the GNU Affero General Public License
## along with this godon. If not, see <http://www.gnu.org/licenses/>.
##
on:
pull_request:
types: [ labeled ]
branches:
- master
env:
INSTANCE_NAME: "ci_runner"
OS_AUTH_URL: https://oprod-controller1.osuosl.org:5000/v3
OS_PROJECT_NAME: "godon"
OS_USER_DOMAIN_NAME: "Default"
OS_PROJECT_DOMAIN_ID: "default"
OS_REGION_NAME: "RegionOne"
OS_IDENTITY_API_VERSION: 3
OS_INTERFACE: public
OS_USERNAME: ${{ secrets.osuosl_openstack_user }}
OS_PASSWORD: ${{ secrets.osuosl_openstack_pw }}
GH_ACTIONS_TOKEN: ${{ secrets.gh_runner_token }}
jobs:
test_stack_rebuild_nixos:
if: ${{ contains(github.event.pull_request.labels.*.name, 'teststack') && contains(github.event.pull_request.labels.*.name, 'rebuild') }}
runs-on: [self-hosted, linux] # only unique osuosl instance
env:
image_pool_dir: "/srv/"
nix_config_path: "testing/infra/machines/nix/configuration.nix"
steps:
- uses: actions/checkout@v2
- name: build test instance nixos configuration
run: >
mkdir -p "${image_pool_dir}";
source /etc/bashrc;
image="$(nixos-generate -f qcow -c "${nix_config_path}" | tail -n 2 | grep qcow2)";
echo "image=${image}" >> $GITHUB_ENV
- name: update image in pool
run: >
source /etc/bashrc;
cp "${image}" "${image_pool_dir}";
# FIXME: not working in straightforward way, because github-runner on
# nixos running in a very restrictive
# e.g. REF: https://github.com/NixOS/nixpkgs/issues/42117
# test_stack_recreate:
# if: ${{ contains(github.event.pull_request.labels.*.name, 'teststack') && contains(github.event.pull_request.labels.*.name, 'recreate') }}
# runs-on: [self-hosted, linux] # only unique osuosl instance
# env:
# MASK_FILE: testing/maskfile.md
# steps:
# - uses: actions/checkout@v2
# - name: cleanup stack
# run: >
# source /etc/bashrc;
# mask --maskfile "${MASK_FILE}" infra cleanup machines;
# mask --maskfile "${MASK_FILE}" infra cleanup network;
# #mask --maskfile "${MASK_FILE}" godon deplete;
# - name: errect stack
# run: >
# source /etc/bashrc;
# mask --maskfile "${MASK_FILE}" infra create machines;
# mask --maskfile "${MASK_FILE}" infra create network;
# #mask --maskfile "${MASK_FILE}" infra provision machines;
# #mask --maskfile "${MASK_FILE}" godon setup;