-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (85 loc) · 2.74 KB
/
storage-aws-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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:
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