Skip to content

Initial

Initial #5

name: Lints-Tests
on:
push:
branches:
- main
- master
pull_request:
permissions:
contents: read
env:
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down
CLOUD_BUCKET_NAME: "${{ secrets.CLOUD_BUCKET_NAME }}"
AWS_REGION: "${{ secrets.AWS_REGION }}"
jobs:
rust-lints-test:
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
- name: Set up Rust
run: rustup override set stable && rustup update
- name: Install clippy
run: rustup component add clippy
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Run cargo clippy
working-directory: ./crates/opsml_storage
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Tests
working-directory: ./crates/opsml_storage
run: make test.aws
env:
RUST_BACKTRACE: 1
test-os:
name: test ${{ matrix.os }}-${{ matrix.python-version }}
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos]
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}-latest
needs: [rust-lints-test]
steps:
- uses: actions/checkout@v4
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
#- uses: "google-github-actions/auth@v2"
#with:
#project_id: ${{ env.GCP_PROJECT_ID }}
#workload_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }}
#- name: "Set up Cloud SDK"
#uses: "google-github-actions/setup-gcloud@v2"
#- name: "Use gcloud CLI"
#run: "gcloud info"
- name: install rust stable
uses: dtolnay/rust-toolchain@stable
- name: cache rust
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ matrix.python-version }}-v1
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: set up python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Create virtual environment
working-directory: ./opsml_storage_s3
run: make setup.project
- name: Lints
working-directory: ./opsml_storage_s3
run: make lints.ci
- name: Run tests and report coverage
working-directory: ./opsml_storage_s3
run: make test.unit