-
Notifications
You must be signed in to change notification settings - Fork 78
163 lines (134 loc) · 4.44 KB
/
CI.yaml
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: CI
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
schedule:
- cron: "0 0 * * *"
jobs:
test:
if: github.event.pull_request.draft == false
name: Foyer Tests (python)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
name: Checkout Branch / Pull Request
- name: Install Mamba (Linux)
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
create-args: python=${{ matrix.python-version }}
- name: Install Package
run: python -m pip install -e .
- name: Test (OS -> ${{ matrix.os }} / Python -> ${{ matrix.python-version }})
run: python -m pytest -v -nauto --cov=foyer --cov-report=xml --cov-append --cov-config=setup.cfg --color yes --pyargs foyer
- name: Upload Coverage Report
uses: codecov/codecov-action@v4
with:
name: Foyer-Coverage
verbose: true
files: ./coverage.xml
arch-test:
if: github.event.pull_request.draft == false
name: Foyer Tests (arch)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, macOS-13, ubuntu-latest, windows-latest]
python-version: ["3.13"]
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
name: Checkout Branch / Pull Request
- name: Install Mamba (Linux)
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
create-args: python=${{ matrix.python-version }}
if: runner.os != 'Windows'
- name: Install Mamba (Windows)
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev-win.yml
create-args: python=${{ matrix.python-version }}
if: runner.os == 'Windows'
- name: Install Package
run: python -m pip install -e .
- name: Test (OS -> ${{ matrix.os }} / Python -> ${{ matrix.python-version }})
run: python -m pytest -v -nauto --color yes --pyargs foyer
bleeding-edge-test:
if: github.event.pull_request.draft == false
name: Bleeding Edge mosdef Tests for Foyer
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
name: Checkout Branch / Pull Request
- name: Install Mamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
create-args: python=3.12
- name: Clone mBuild and GMSO
run: |
git clone https://github.com/mosdef-hub/mbuild.git
git clone https://github.com/mosdef-hub/gmso.git
- name: Update Environment with mbuild/gmso Dependencies
run: |
micromamba update --name foyer-dev --file mbuild/environment.yml
micromamba update --name foyer-dev --file gmso/environment.yml
- name: Install Packages from Source
run: |
pip install -e mbuild
pip install -e gmso
pip install -e .
- name: Run Bleeding Edge Tests
run: |
python -m pytest -v -nauto --color yes --pyargs foyer
docker:
runs-on: ubuntu-latest
needs: test
name: Build Docker Image
if: github.event_name != 'pull_request'
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Get Tagged Version
run: |
echo "DOCKER_TAGS=mosdef/foyer:${GITHUB_REF_NAME}, mosdef/foyer:stable" >> $GITHUB_ENV
if: github.ref_type == 'tag'
- name: Get Push Version
run: |
echo "DOCKER_TAGS=mosdef/foyer:${GITHUB_REF_NAME}, mosdef/foyer:latest" >> $GITHUB_ENV
if: github.ref_type == 'branch'
- name: Docker Image Info
run: |
echo Docker Image tags: ${DOCKER_TAGS}
- name: Build and Push
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ env.DOCKER_TAGS }}