Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2

updates:
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "daily"
26 changes: 14 additions & 12 deletions .github/workflows/ai4sim-ci-cd.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ai4sim-ci-cd

on: [push, pull_request]
on: [pull_request]

permissions:
actions: write
Expand All @@ -19,25 +19,21 @@ jobs:
- reactive-flows/cnf-combustion/unets
- weather-forecast/gravity-wave-drag/cnns
- weather-forecast/ecrad-3d-correction/unets
- weather-forecast/nwp-emulation/panguweather
fail-fast: false

steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Read model-project env.yaml file
uses: pietrobolcato/action-read-yaml@1.1.0
id: uc_env
with:
config: ${{ matrix.model-project }}/env.yaml

- name: Set up Python ${{ steps.uc_env.outputs['python_version'] }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ steps.uc_env.outputs['python_version'] }}

- name: Install nox build tool
run: pip3 install $(grep nox== ${{ matrix.model-project }}/requirements.txt)
run: pip3 install nox$(grep nox.needs_version ${{ matrix.model-project }}/noxfile.py | sed -rn "s/.*\"([><=]=.*)\"/\1/p")

- name: Install uv tool
run: pip3 install uv

- name: Analysing the code with flake8
working-directory: ${{ matrix.model-project }}
Expand All @@ -57,6 +53,12 @@ jobs:
nox -s black -v -- check-only
rm -rf .nox

- name: Analysing the code with mypy
working-directory: ${{ matrix.model-project }}
run: |
nox -s mypy
rm -rf .nox

- name: Run unit tests with coverage report
working-directory: ${{ matrix.model-project }}
run: |
Expand Down Expand Up @@ -91,7 +93,7 @@ jobs:
runs-on: ubuntu-latest

needs: run-checks
if: github.event.pull_request.user.login == 'dependabot[bot]'
if: ${{ (github.event.pull_request.user.login == 'dependabot[bot]') || (github.event.repository.name == 'model-collection') }}

steps:
- name: Checkout sources
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/images-ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
push_to_registries:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
runs-on: linux-large
permissions:
packages: write
contents: read
Expand All @@ -23,6 +23,7 @@ jobs:
- reactive-flows/cnf-combustion/unets
- weather-forecast/gravity-wave-drag/cnns
- weather-forecast/ecrad-3d-correction/unets
- weather-forecast/nwp-emulation/panguweather
fail-fast: false

steps:
Expand Down Expand Up @@ -79,7 +80,6 @@ jobs:
build-args: |
UBUNTU_IMAGE_NAME=${{ steps.uc_env.outputs['ubuntu_base_image.name'] }}
UBUNTU_IMAGE_TAG=${{ steps.uc_env.outputs['ubuntu_base_image.tag'] }}
PYTHON_VERS=${{ steps.uc_env.outputs['python_version'] }}
MODEL_PROJECT_PATH=${{ matrix.model-project }}
load: true
tags: "${{ steps.image.outputs.name }}:${{ steps.image.outputs.tag }}"
Expand All @@ -104,6 +104,6 @@ jobs:
UBUNTU_IMAGE_TAG=${{ steps.uc_env.outputs['ubuntu_base_image.tag'] }}
PYTHON_VERS=${{ steps.uc_env.outputs['python_version'] }}
MODEL_PROJECT_PATH=${{ matrix.model-project }}
push: true
push: ${{ github.event.repository.name == 'model-collection' }}
tags: "${{ steps.image.outputs.name }}:${{ steps.image.outputs.tag }}"
labels: ${{ steps.meta.outputs.labels }}
51 changes: 51 additions & 0 deletions .github/workflows/pr-to-public.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: merge-to-public

on:
push:
# branches:
# - main

permissions:
actions: write
checks: write
contents: write
pull-requests: write
repository-projects: write

jobs:
create-pr:
runs-on: ubuntu-latest

if: github.event.repository.name == 'model-collection-private'

steps:
- name: Checkout private sources
uses: actions/checkout@v6
with:
path: private
fetch-depth: 0

- name: Checkout public sources
uses: actions/checkout@v6
with:
repository: AI4SIM/model-collection
path: public
fetch-depth: 0
token: ${{ secrets.TOKEN }}

- name: Create merge branch and push
run: |
cd private
git checkout -b merge-private-into-public
git push ../public merge-private-into-public
cd ../public
git config --global user.name 'github-actions[bot]'
git config --global user.email 'username@users.noreply.github.com'
git push origin merge-private-into-public

- name: Create a PR
run: |
cd public
gh pr create -B main -H merge-private-into-public -R AI4SIM/model-collection --title 'Merge private into public' --body 'Created by Github action'
env:
GH_TOKEN: ${{ secrets.TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ __pycache__/
.coverage.*
coverage.xml

# Type hinting
.mypy_cache/

# Jupyter Notebook
.ipynb_checkpoints

Expand Down
Loading
Loading