-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #188 from cyclus/convert-ci
Update Cymetric CI
- Loading branch information
Showing
21 changed files
with
2,274 additions
and
2,238 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
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' | ||
- 'docker/**' | ||
- 'doc/**' | ||
- 'CHANGELOG.rst' | ||
push: | ||
paths-ignore: | ||
- '.github/workflows/build_test_publish.yml' | ||
- 'docker/**' | ||
- 'doc/**' | ||
- 'CHANGELOG.rst' | ||
|
||
jobs: | ||
build-and-test: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ubuntu_versions : [ | ||
20.04, | ||
22.04, | ||
] | ||
pkg_mgr : [ | ||
apt, | ||
conda, | ||
] | ||
cycamore_tag: [ | ||
latest, | ||
] | ||
|
||
container: | ||
image: ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:${{matrix.cycamore_tag}} | ||
|
||
steps: | ||
- name: Checkout Cymetric | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Cymetric Apt Dependencies | ||
if: matrix.pkg_mgr == 'apt' | ||
run: | | ||
apt update --fix-missing && apt install -y python3-pip python3-pytest | ||
- name: Install Cymetric Conda Dependencies | ||
if: matrix.pkg_mgr == 'conda' | ||
run: | | ||
mamba install -y pip pytest | ||
- name: Build Cymetric | ||
run: | | ||
python -m pip install --target $(python -m site --user-site) . | ||
- name: Cymetric Tests | ||
run: | | ||
export PYTHONPATH=$(find /root/.local/lib -type d -name 'cyclus-*-*.egg' -print -quit) | ||
cd tests && python -m pytest |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Build and Publish Cymetric Images | ||
|
||
on: | ||
# allows us to run workflows manually | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- '.github/workflows/build_test_publish.yml' | ||
- 'docker/**' | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-dependency-and-test-img: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
ubuntu_versions : [ | ||
20.04, | ||
22.04, | ||
] | ||
pkg_mgr : [ | ||
apt, | ||
conda, | ||
] | ||
|
||
name: Installing Dependencies, Building Cymetric 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' && github.ref == 'refs/heads/main' }} | ||
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: Multi-Stage Build Action | ||
uses: firehed/multistage-docker-build-action@v1 | ||
with: | ||
repository: ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }} | ||
stages: cymetric | ||
server-stage: cymetric-pytest | ||
quiet: false | ||
parallel: true | ||
tag-latest-on-default: ${{ env.tag-latest-on-default }} | ||
dockerfile: docker/Dockerfile | ||
build-args: pkg_mgr=${{ matrix.pkg_mgr }}, ubuntu_version=${{ matrix.ubuntu_versions }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Changelog check | ||
|
||
on: | ||
# allows us to run workflows manually | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
changelog_update: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: alpine:3.14 | ||
|
||
name: Is Changelog up-to-date ? | ||
steps: | ||
- name: Install latest git | ||
run: | | ||
apk add --no-cache bash git openssh | ||
git --version | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- run: | | ||
git config --global --add safe.directory ${GITHUB_WORKSPACE} | ||
cd $GITHUB_WORKSPACE | ||
git remote add cymetric https://github.com/cyclus/cymetric.git | ||
git fetch cymetric | ||
change=`git diff cymetric/main -- CHANGELOG.rst | wc -l` | ||
git remote remove cymetric | ||
if [ $change -eq 0 ]; then | ||
echo "CHANGELOG.rst has not been updated" | ||
exit 1 | ||
fi |
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ARG pkg_mgr=apt | ||
ARG ubuntu_version=22.04 | ||
|
||
FROM ghcr.io/cyclus/cycamore_${ubuntu_version}_${pkg_mgr}/cycamore as cycamore | ||
|
||
FROM cycamore as apt-deps | ||
RUN apt update --fix-missing && apt install -y python3-pip python3-pytest | ||
|
||
FROM cycamore as conda-deps | ||
RUN mamba install -y pip pytest | ||
|
||
FROM ${pkg_mgr}-deps as cymetric | ||
COPY . /cymetric | ||
WORKDIR /cymetric | ||
RUN python -m pip install --target $(python -m site --user-site) . | ||
|
||
FROM cymetric as cymetric-pytest | ||
RUN cd tests && python -m pytest |
Oops, something went wrong.