-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (73 loc) · 2.18 KB
/
python-app.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Procsim tests
on:
push:
branches:
- '*'
tags:
- '*'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pycodestyle
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with pycodestyle
run: |
pycodestyle . --max-line-length=150
- name: Test with pytest
run: |
pytest
- name: Test Biomass
run: |
pip install -e .
test/biomass/test_no_pvml.sh
- name: Test FLEX
run: |
pip install -e .
cd examples_flex
./run_all_test_scenario.sh --no-wait
./run_cal_test_scenario.sh
./generate_aux.sh
./generate_raw.sh
- name: Build
id: pack_tarball
run: |
./build.sh
PACK_NAME=$(ls *.tgz | head -n 1)
echo "tar_filename=$PACK_NAME" >> $GITHUB_OUTPUT
- name: Create release
if: startsWith(github.ref, 'refs/tags/')
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: CHANGELOG
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release asset
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ steps.pack_tarball.outputs.tar_filename }}
asset_name: ${{ steps.pack_tarball.outputs.tar_filename }}
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}