Skip to content

Commit

Permalink
Merge pull request #195 from cyclus/ci-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gonuke authored Feb 15, 2024
2 parents 4b7796c + 2dc786c commit f443378
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 24 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ on:
jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

strategy:
fail-fast: false
Expand All @@ -43,13 +40,6 @@ jobs:
- name: Checkout Cymetric
uses: actions/checkout@v4

- 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

Expand All @@ -58,8 +48,7 @@ jobs:
continue-on-error: true
uses: docker/build-push-action@v5
with:
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache,mode=max
cache-from: type=registry,ref=ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache
file: docker/Dockerfile
build-args: |
pkg_mgr=${{ matrix.pkg_mgr }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
Expand All @@ -55,11 +55,11 @@ jobs:
- name: Build and Test Cymetric
uses: docker/build-push-action@v5
with:
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache,mode=max
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
file: docker/Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:${{ env.tag }}
tags: ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:${{ env.tag }}
build-args: |
pkg_mgr=${{ matrix.pkg_mgr }}
ubuntu_version=${{ matrix.ubuntu_versions }}
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Publish Stable Cymetric

on:
pull_request:
paths:
- '.github/workflows/publish_release.yml'
release:
types: [released]

Expand Down Expand Up @@ -31,7 +34,7 @@ jobs:
echo "stable_tag=ci-image-cache" >> "$GITHUB_ENV"
- name: Tag as stable
if: ${{ github.repository_owner == 'cyclus' }}
if: ${{ github.repository_owner == 'cyclus' && github.event_name == 'release' }}
run: |
echo "version_tag=${{ github.event.release.tag_name }}" >> "$GITHUB_ENV"
echo "stable_tag=stable" >> "$GITHUB_ENV"
Expand All @@ -40,7 +43,7 @@ jobs:
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
Expand All @@ -52,13 +55,12 @@ jobs:
- name: Build and Test Cymetric
uses: docker/build-push-action@v5
with:
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache,mode=max
cache-from: type=registry,ref=ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache
file: docker/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:${{ env.version_tag }}
ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:${{ env.stable_tag }}
ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:${{ env.version_tag }}
ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:${{ env.stable_tag }}
build-args: |
pkg_mgr=${{ matrix.pkg_mgr }}
ubuntu_version=${{ matrix.ubuntu_versions }}
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cymetric Change Log

.. current developments
**Added:**
* GitHub workflows for CI (#188, #190, #191, #193)
* GitHub workflows for CI (#188, #190, #191, #193, #195)

**Changed**
* Converted test suite from nose to pytest (#188)
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG pkg_mgr=apt
ARG ubuntu_version=22.04
ARG cycamore_tag=stable
ARG cycamore_tag=latest

FROM ghcr.io/cyclus/cycamore_${ubuntu_version}_${pkg_mgr}/cycamore:${cycamore_tag} as cymetric

Expand Down

0 comments on commit f443378

Please sign in to comment.