-
Notifications
You must be signed in to change notification settings - Fork 3
101 lines (96 loc) · 2.94 KB
/
dev.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
# This is a basic workflow to help you get started with Actions
name: CI
on:
push:
branches: ["dev"]
# Match tags that resemble a version
tags: ['[0-9]+\.[0-9]+\.[0-9]+']
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# test job includes unit tests and coverage
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with: {python-version: "3.9"}
- name: Run static analysis and format checkers
run: pipx run pre-commit run --all-files --show-diff-on-failure
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
# Support for Python 3.10 and 3.11 is temproarily disabled
# - "3.10"
# - "3.11"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install pytest pytest-cov
- name: Test with pytest
run: |
pytest tests/ --cov=agoradatatools --cov-report=html
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: htmlcov
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
# build job includes integration test
build:
needs: [test]
# The type of runner that the job will run on
name: test data processing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- run: pip install -U setuptools
- run: pip install .
- run: adt test_config.yaml -t ${{secrets.SYNAPSE_PAT}}
ghcr-publish:
needs: [build, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
type=sha
latest
- name: Publish Docker Image
uses: docker/build-push-action@v3
with:
context: .
build-args: |
TARBALL_PATH=${{ needs.prepare.outputs.tarball-path }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}