-
Notifications
You must be signed in to change notification settings - Fork 40
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 #573 from cyclus/tag-build-arg
- Loading branch information
Showing
7 changed files
with
232 additions
and
84 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Publish Latest Cycamore | ||
|
||
on: | ||
# allows us to run workflows manually | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- '.github/workflows/publish_latest.yml' | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-dependency-and-test-img: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
strategy: | ||
matrix: | ||
ubuntu_versions : [ | ||
20.04, | ||
22.04, | ||
] | ||
pkg_mgr : [ | ||
apt, | ||
conda, | ||
] | ||
|
||
name: Build, Test, Publish | ||
steps: | ||
- name: Tag as ci-image-cache | ||
run: | | ||
echo "tag=ci-image-cache" >> "$GITHUB_ENV" | ||
- name: Tag as latest | ||
if: ${{ github.repository_owner == 'cyclus' && github.ref == 'refs/heads/main' }} | ||
run: | | ||
echo "tag=latest" >> "$GITHUB_ENV" | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and Test Cycamore | ||
id: build-cycamore | ||
uses: docker/build-push-action@v5 | ||
with: | ||
cache-from: type=registry,ref=ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:ci-layer-cache | ||
cache-to: type=registry,ref=ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:ci-layer-cache,mode=max | ||
file: docker/Dockerfile | ||
push: true | ||
tags: ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:${{ env.tag }} | ||
build-args: | | ||
pkg_mgr=${{ matrix.pkg_mgr }} | ||
ubuntu_version=${{ matrix.ubuntu_versions }} | ||
cyclus_tag=latest | ||
- name: Checkout Cymetric | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: cyclus/cymetric | ||
path: ${{ github.workspace }}/cymetric | ||
|
||
- name: Build and Test Cymetric | ||
continue-on-error: true | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ${{ github.workspace }}/cymetric | ||
file: ${{ github.workspace }}/cymetric/docker/Dockerfile | ||
cache-from: type=registry,ref=ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache | ||
cache-to: type=registry,ref=ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache,mode=max | ||
tags: ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:${{ env.tag }} | ||
push: true | ||
build-args: | | ||
pkg_mgr=${{ matrix.pkg_mgr }} | ||
ubuntu_version=${{ matrix.ubuntu_versions }} | ||
cycamore_tag=${{ env.tag }}@${{ steps.build-cycamore.outputs.digest }} | ||
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,65 @@ | ||
name: Publish Stable Cycamore | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
build-and-test-for-release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ubuntu_versions : [ | ||
20.04, | ||
22.04, | ||
] | ||
pkg_mgr : [ | ||
apt, | ||
conda | ||
] | ||
|
||
name: Build, Test, Publish | ||
steps: | ||
- name: Tag as ci-image-cache | ||
run: | | ||
echo "version_tag=ci-image-cache" >> "$GITHUB_ENV" | ||
echo "stable_tag=ci-image-cache" >> "$GITHUB_ENV" | ||
- name: Tag as stable | ||
if: ${{ github.repository_owner == 'cyclus' }} | ||
run: | | ||
echo "version_tag=${{ github.ref_name }}" >> "$GITHUB_ENV" | ||
echo "stable_tag=stable" >> "$GITHUB_ENV" | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Checkout Cycamore | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build, Test, and Push Cycamore | ||
uses: docker/build-push-action@v5 | ||
with: | ||
cache-from: type=registry,ref=ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:ci-layer-cache | ||
cache-to: type=registry,ref=ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:ci-layer-cache,mode=max | ||
file: docker/Dockerfile | ||
push: true | ||
tags: | | ||
ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:${{ env.version_tag }} | ||
ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:${{ env.stable_tag }} | ||
build-args: | | ||
pkg_mgr=${{ matrix.pkg_mgr }} | ||
ubuntu_version=${{ matrix.ubuntu_versions }} | ||
cyclus_tag=stable |
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 |
---|---|---|
@@ -1,16 +1,17 @@ | ||
ARG pkg_mgr=apt | ||
ARG ubuntu_version=22.04 | ||
ARG cyclus_tag=stable | ||
|
||
FROM ghcr.io/cyclus/cyclus_${ubuntu_version}_${pkg_mgr}/cyclus as cycamore | ||
FROM ghcr.io/cyclus/cyclus_${ubuntu_version}_${pkg_mgr}/cyclus:${cyclus_tag} as cycamore | ||
ARG make_cores=2 | ||
|
||
COPY . /cycamore | ||
WORKDIR /cycamore | ||
|
||
RUN python install.py -j ${make_cores} --build-type=Release --core-version 99999.99999 | ||
RUN python install.py -j ${make_cores} --build-type=Release --core-version 999999.999999 | ||
|
||
FROM cycamore as cycamore-test | ||
RUN cycamore_unit_tests | ||
|
||
FROM cycamore as cycamore-pytest | ||
RUN cd tests && python -m pytest | ||
FROM cycamore-test as cycamore-pytest | ||
RUN cd tests && python -m pytest |