Skip to content

Commit e462583

Browse files
committed
Merge remote-tracking branch 'origin/main' into remove-pacs
2 parents a748037 + 0b52f84 commit e462583

34 files changed

Lines changed: 522 additions & 299 deletions

.github/actions/codecov/action.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Code coverage
2+
description: Generate code coverage and upload to codecov
3+
inputs:
4+
token:
5+
description: Codecov token
6+
required: true
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Install cargo-llvm-cov
12+
shell: bash
13+
run: cargo install cargo-llvm-cov
14+
15+
- name: Generate code coverage
16+
shell: bash
17+
run: cargo llvm-cov --codecov --output-path codecov.json
18+
19+
- name: Upload to codecov.io
20+
uses: codecov/codecov-action@v5
21+
with:
22+
token: ${{ inputs.token }}
23+
fail_ci_if_error: true

.github/workflows/cargo-build-and-test.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/cargo-test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Cargo Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
build_and_test:
11+
name: Run tests
12+
runs-on: ${{ matrix.os }}
13+
timeout-minutes: 15
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, windows-latest, macos-latest]
18+
include:
19+
- os: ubuntu-latest
20+
coverage: true
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions-rust-lang/setup-rust-toolchain@v1
24+
with:
25+
toolchain: stable
26+
- run: cargo test --verbose
27+
28+
- if: ${{ matrix.coverage }}
29+
uses: ./.github/actions/codecov
30+
with:
31+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/check-docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches: [main]
55
pull_request:
6+
workflow_dispatch:
67
schedule:
78
- cron: "0 0 * * 1" # midnight every Monday
89

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches: [main]
66
pull_request:
7+
workflow_dispatch:
78

89
jobs:
910
pre-commit:

.github/workflows/release.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Release
2+
on:
3+
push:
4+
branches: [main]
5+
release:
6+
workflow_dispatch:
7+
8+
jobs:
9+
build_and_upload:
10+
name: Build release
11+
timeout-minutes: 15
12+
runs-on: ${{ matrix.os }}
13+
container:
14+
image: ${{ matrix.image }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-latest, macos-latest]
19+
archive_ext: [tar.gz]
20+
archive_cmd: ["tar cf"]
21+
include:
22+
- os: ubuntu-latest
23+
osname: linux
24+
# We build on an old Linux distro so that we get an older version of libstdc++.
25+
# libstdc++ has good backwards compatibility (but not forwards) so by linking against an
26+
# old version, we can target more Linuxes.
27+
image: debian:oldstable
28+
- os: windows-latest
29+
osname: windows
30+
archive_ext: zip
31+
archive_cmd: 7z a
32+
exe_suffix: .exe
33+
- os: macos-latest
34+
osname: macos_arm
35+
steps:
36+
- uses: actions/checkout@v4
37+
- name: Install extra dependencies on Linux
38+
if: ${{ matrix.osname == 'linux' }}
39+
run: |
40+
apt update
41+
apt install -y curl build-essential cmake libclang-16-dev
42+
- uses: actions-rust-lang/setup-rust-toolchain@v1
43+
with:
44+
toolchain: stable
45+
- run: cargo build --release
46+
- name: Gather release files
47+
run: |
48+
mkdir muse2
49+
cp target/release/muse2${{ matrix.exe_suffix }} muse2
50+
cp LICENSE muse2/LICENCE.txt
51+
cp assets/readme/readme_${{ matrix.osname }}.txt muse2/README.txt
52+
- uses: actions/upload-artifact@v4
53+
if: ${{ github.event_name != 'release' }}
54+
with:
55+
name: muse2_${{ matrix.osname }}
56+
path: muse2
57+
- name: Archive release
58+
if: ${{ github.event_name == 'release' }}
59+
run: |
60+
cd muse2
61+
${{ matrix.archive_cmd }} ../muse2_${{ matrix.osname }}.${{ matrix.archive_ext }} *
62+
- name: Upload release artifacts
63+
if: ${{ github.event_name == 'release' }}
64+
uses: softprops/action-gh-release@v2
65+
with:
66+
files: muse2_${{ matrix.osname }}.${{ matrix.archive_ext }}

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ repos:
2626
rev: v1.0
2727
hooks:
2828
- id: clippy
29+
- repo: https://github.com/astral-sh/ruff-pre-commit
30+
rev: v0.11.6
31+
hooks:
32+
- id: ruff
33+
types_or: [python]
34+
args: [--fix]
35+
- id: ruff-format
36+
types_or: [python]
2937
- repo: https://github.com/codespell-project/codespell
3038
rev: v2.2.6
3139
hooks:

.vscode/extensions.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"vadimcn.vscode-lldb",
55
"editorconfig.editorconfig",
66
"esbenp.prettier-vscode",
7-
"davidanson.vscode-markdownlint"
7+
"davidanson.vscode-markdownlint",
8+
"samuelcolvin.jinjahtml",
9+
"ms-python.python",
10+
"charliermarsh.ruff"
811
]
912
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- markdownlint-disable MD041 -->
2-
[![Build and test](https://github.com/EnergySystemsModellingLab/MUSE_2.0/actions/workflows/cargo-build-and-test.yml/badge.svg)](https://github.com/EnergySystemsModellingLab/MUSE_2.0/actions/workflows/cargo-build-and-test.yml)
2+
[![Build and test](https://github.com/EnergySystemsModellingLab/MUSE_2.0/actions/workflows/cargo-test.yml/badge.svg)](https://github.com/EnergySystemsModellingLab/MUSE_2.0/actions/workflows/cargo-test.yml)
33
[![codecov](https://codecov.io/github/EnergySystemsModellingLab/MUSE_2.0/graph/badge.svg?token=nV8gp1NCh8)](https://codecov.io/github/EnergySystemsModellingLab/MUSE_2.0)
44
[![GitHub](https://img.shields.io/github/license/EnergySystemsModellingLab/MUSE_2.0)](https://raw.githubusercontent.com/EnergySystemsModellingLab/MUSE_2.0/main/LICENSE)
55

assets/readme/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Readme files for MUSE 2.0
2+
3+
This folder contains readme files to be included with MUSE 2.0 releases.

0 commit comments

Comments
 (0)