Repository navigation
97 lines (80 loc) · 2.65 KB
/
Copy pathgithub_actions_ci.yml
File metadata and controls
97 lines (80 loc) · 2.65 KB
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
# This workflow will:
# 1. Install Python dependencies, run tests and lint on Ubuntu and macOS
# 2. If tests succeeded, create a Docker image and publish in to Docker Hub
# 3. Run the created Docker image on Ubuntu and check that it works correctly
name: Linux, MacOS, Docker
on:
push:
branches:
- master
tags:
- v*
pull_request:
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install cython
pip install -r requirements.txt
- name: Check g++ version
run: |
g++ --version
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest sosed_test/test_data_processing.py
- name: Setup tokenizer
run: |
# Download tokenizer and its dependencies
python -m sosed.setup_tokenizer
- name: Run integration test
run: |
pytest sosed_test/test_pipeline.py
push:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/build-push-action@v1
name: Build & push Docker image
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: egorbogomolov/sosed
tag_with_ref: true
tag_with_sha: true
verify-image-unix:
if: github.event_name != 'pull_request'
needs: push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Pull docker image
run: docker pull egorbogomolov/sosed:latest
- name: Run help from Docker
run: docker run egorbogomolov/sosed:latest
- name: Run the tool from Docker
shell: bash
run: docker run
--mount type=bind,source="$(pwd)"/input_examples,target=/input_examples/
--mount type=bind,source="$(pwd)"/output,target=/output/
--mount type=bind,source="$(pwd)"/data,target=/data
egorbogomolov/sosed:latest -i input_examples/input.txt -o output/examples_output/