update docs
[MACS.git] / .github / workflows / build-and-test-MACS3-x64.yml
blobd9aa9ed5ed2114e62f8da2f5246fe4963539ee25
1 # This workflow will install Python dependencies, run tests and lint with a single version of Python
2 # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
4 name: MACS3 CI x64
6 on: 
7   push:
8     paths-ignore:
9       - 'docs/**'
10       - '**.md'
11       - '.github/workflows/**'
12       - '!.github/workflows/build-and-test-MACS3-x64.yml'
13   pull_request:
14     paths-ignore:
15       - 'docs/**'
16       - '**.md'
17       - '.github/workflows/**'
18       - '!.github/workflows/build-and-test-MACS3-x64.yml'
20 jobs:
21   build:
22     runs-on: ubuntu-22.04
23     strategy:
24       matrix:
25         python-version: ["3.9", "3.10", "3.11", "3.12"]
26         arch: ['x64']
27     name: Build on x64 with Python ${{ matrix.python-version }}
28     steps:
29       - name: Checkout MACS
30         uses: actions/checkout@v4
31         with:
32           submodules: 'true'
33       - name: Set up Python ${{ matrix.python-version }}
34         uses: actions/setup-python@v5
35         with:
36           python-version: ${{ matrix.python-version }}
37           architecture: ${{ matrix.arch }}
38       - name: Cache pip
39         uses: actions/cache@v4
40         with:
41           # This path is specific to Ubuntu
42           path: ~/.cache/pip
43           # Look to see if there is a cache hit for the corresponding requirements file
44           key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
45           restore-keys: |
46             ${{ runner.os }}-pip-
47             ${{ runner.os }}-
48       - name: Install dependencies
49         run: |
50           # make sure pip is the lastest
51           python3 -m pip install --upgrade pip
52           python3 -m pip install pytest
53           if [ -f requirements.txt ]; then python3 -m pip install --upgrade -r requirements.txt; fi
54       - name: Install MACS
55         run: |
56           # we use pip install instead of old fashion setup.py install
57           python3 -m pip install .
58       - name: Output versions of installed libraries 
59         run: |
60           python3 -m pip freeze
61       - name: Test with pytest
62         run: |
63           pytest --runxfail
64           cd test
65           ./cmdlinetest macs3
66           cd ..
67       - name: Build sdist
68         run: |
69           python3 setup.py sdist
70       - name: Archive sdist
71         uses: actions/upload-artifact@v4
72         with:
73           name: sdist-${{ matrix.arch }}-${{ matrix.python-version }}
74           path: |
75             dist/*.tar.gz