Initial support for hotfix integration as outlined in milestone 6. (#… #414
This file contains hidden or 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: Continuous Integration | |
| on: | |
| # Triggers the workflow on push or pull request events but only for the master branch | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| branches: | |
| - master | |
| paths-ignore: | |
| - '**/README.*' | |
| - 'doc/**' | |
| - '1.gocd.yml' | |
| - '.gitignore' | |
| - '.spellcheck.yml' | |
| - '.spellcheckwordlist.txt' | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - '**/README.*' | |
| - 'doc/**' | |
| - '1.gocd.yml' | |
| - '.gitignore' | |
| - '.spellcheck.yml' | |
| - '.spellcheckwordlist.txt' | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| build-run-test: | |
| # Mimic modern RHEL/Rocky with latest Ubuntu LTS | |
| # IMPORTANT: ubuntu-latest started throwing bash errors on make test-doc | |
| # Maybe fall-out from the planned switch to ubuntu-24.04 as | |
| # ubuntu-latest in December 2024. We stick with 22.04 for now. | |
| #runs-on: ubuntu-latest | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| container_os: [rocky9] | |
| environment_profile: [development] | |
| steps: | |
| - name: Check out repository contents | |
| uses: actions/checkout@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Lint Dockerfile with Hadolint | |
| uses: hadolint/hadolint-action@v3.1.0 | |
| with: | |
| dockerfile: Dockerfile.${{ matrix.container_os }} | |
| failure-threshold: error | |
| output-file: hadolint_Dockerfile.${{ matrix.container_os }}.out | |
| # NOTE: disabled next now we have cleaned enough to stop lint errors | |
| #no-fail: true | |
| - name: Print Hadolint results | |
| run: | | |
| echo '================================================' | |
| echo 'HADOLINT RESULTS' | |
| cat hadolint_Dockerfile.${{ matrix.container_os }}.out | |
| echo '================================================' | |
| - name: Run tests for documentation | |
| run: | | |
| make test-doc | |
| - name: Build images | |
| run: | | |
| ln -s -f Dockerfile.${{ matrix.container_os }} Dockerfile | |
| ln -s -f docker-compose_${{ matrix.environment_profile }}.yml docker-compose.yml | |
| ln -s -f ${{ matrix.environment_profile }}.env .env | |
| make init | |
| echo "# NOTE: use absolute paths to current dir to get docker bind mounts to work" > ci.env | |
| echo "DOCKER_MIGRID_ROOT=$PWD" >> ci.env | |
| echo "# NOTE: leave implicit python and branch for a modern runtime" >> ci.env | |
| echo "#PREFER_PYTHON3=True" >> ci.env | |
| echo "#MIG_GIT_BRANCH=next" >> ci.env | |
| echo "" >> ci.env | |
| grep -E -v "^(DOCKER_MIGRID_ROOT|PREFER_PYTHON3|MIG_GIT_BRANCH)=" .env >> ci.env | |
| rm -f .env | |
| mv ci.env .env | |
| make dockerbuild | |
| - name: Start services | |
| run: | | |
| make up | |
| - name: Run tests | |
| run: | | |
| make test | |
| - name: Read docker compose logs | |
| run: | | |
| make logs | |
| - name: Read migrid logs | |
| run: | | |
| tail -n +1 state/log/* | |
| - name: Stop services | |
| run: | | |
| make down |