Merge pull request #65 from brianphung/write_convergence_history #272
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
name: Norma CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 8 * * *' # Midnight PST (8:00 UTC) | |
jobs: | |
test: | |
name: Run Tests | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
julia-version: ["1.10", "1.11"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Julia | |
uses: julia-actions/setup-julia@v1 | |
with: | |
version: ${{ matrix.julia-version }} | |
- name: Remove existing Manifest.toml | |
run: rm -f Manifest.toml | |
- name: Install dependencies | |
run: julia --project=. -e 'using Pkg; Pkg.instantiate()' | |
- name: Format code (scheduled runs only) | |
if: github.event_name == 'schedule' | |
run: | | |
julia --project=. -e ' | |
using Pkg | |
Pkg.add("JuliaFormatter") | |
using JuliaFormatter | |
format(".")' | |
- name: Commit and push changes (scheduled runs only) | |
if: github.event_name == 'schedule' | |
run: | | |
git config --global user.name "github-actions" | |
git config --global user.email "github-actions@github.com" | |
git add . | |
if ! git diff --cached --quiet; then | |
git commit -m "Apply automatic formatting via JuliaFormatter" | |
git push origin main | |
fi | |
- name: Run tests | |
run: julia --project=. -e 'using Pkg; Pkg.test()' |