Skip to content

Commit

Permalink
Merge pull request cyclus#1597 from bennibbelink/main
Browse files Browse the repository at this point in the history
Address Issue cyclus#1595
  • Loading branch information
gonuke authored Oct 17, 2023
2 parents af366c0 + 5bf788e commit 23c0504
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build/Test for PR and collaborator push

on:
# allows us to run workflows manually
workflow_dispatch:
pull_request:
paths-ignore:
- '.github/workflows/build_test_publish.yml'
- '.github/workflows/changelog_test.yml'
- 'docker/**'
- 'doc/**'
push:
paths-ignore:
- '.github/workflows/build_test_publish.yml'
- '.github/workflows/changelog_test.yml'
- 'docker/**'
- 'doc/**'

jobs:
build-and-test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
ubuntu_versions : [
22.04,
]
pkg_mgr : [
apt,
conda
]

container:
image: ghcr.io/${{ github.repository_owner }}/cyclus_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/${{ matrix.pkg_mgr }}-deps

steps:
- name: Checkout and Build Cyclus
uses: actions/checkout@v3

- name: Building Cyclus
run: |
python install.py -j 2 --build-type=Release --core-version 999999.999999
echo "PATH=${HOME}/.local/bin:$PATH" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${HOME}/.local/lib:${HOME}/.local/lib/cyclus:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"
- name: Cyclus Unit Tests
run: |
cyclus_unit_tests
- name: Cyclus Python Tests
run: |
cd tests && python -m pytest --ignore test_main.py
5 changes: 4 additions & 1 deletion .github/workflows/build_test_publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, Test & Publish docker images for future CI and other users
name: Build and Test Dependency Images

on:
# allows us to run workflows manually
Expand All @@ -7,6 +7,9 @@ on:
push:
branches:
- main
paths:
- '.github/workflows/build_test_publish.yml'
- 'docker/**'

jobs:
build-dependency-and-test-img:
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish Cyclus Release

on:
release:
types: [published, created, edited]

jobs:
build-and-test-for-release:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
ubuntu_versions : [
22.04,
]
pkg_mgr : [
apt,
conda
]

name: Installing Dependencies, Building cyclus and running tests
steps:
- name: default environment
run: |
echo "tag-latest-on-default=false" >> "$GITHUB_ENV"
- name: condition on trigger parameters
if: ${{ github.repository_owner == 'cyclus' }}
run: |
echo "tag-latest-on-default=true" >> "$GITHUB_ENV"
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout repository
uses: actions/checkout@v3

- name: Installing Dependencies in Docker image
uses: firehed/multistage-docker-build-action@v1
with:
repository: ghcr.io/${{ github.repository_owner }}/cyclus_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}_${{ github.ref }}
stages: ${{ matrix.pkg_mgr }}-deps, cyclus
server-stage: cyclus-test
quiet: false
parallel: true
tag-latest-on-default: ${{ env.tag-latest-on-default }}
dockerfile: docker/Dockerfile
build-args: pkg_mgr=${{ matrix.pkg_mgr }}
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Since last release
will fail unless update-alternatives has been used to point python at the
correct python3 version (#1558)
* build and test are now fown on githubAction in place or CircleCI (#1569)
* Have separate workflows for testing, publishing dependency images, and publishing release images (#1597)


**Changed:**
Expand Down
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ ENV PATH /opt/conda/bin:$PATH

RUN conda config --add channels conda-forge
RUN conda update -n base -c defaults conda
RUN conda install -y conda-libmamba-solver
RUN conda config --set solver libmamba
RUN conda install -y mamba
RUN conda uninstall -y conda-libmamba-solver
RUN conda config --set solver classic
RUN conda update -y --all && \
mamba install -y \
openssh \
Expand Down

0 comments on commit 23c0504

Please sign in to comment.