-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (75 loc) · 2.86 KB
/
tests-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
name: Run tests on dev branch
on:
push:
branches:
- dev
jobs:
run-tests-dev:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Pip install packages
run: |
python -m pip install -U pip
pip install --no-cache-dir domino-py[cli]
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: pip list
run: pip list | grep domino
- name: Run organize and build images
run: |
domino piece organize --build-images --source-url=https://github.com/${{github.repository}} --tag-overwrite=development
- name: Install Tests Dependencies
run: pip install -r requirements-tests.txt
# Remember to pass any necessary secrets as env vars here
- name: Run tests over built images
env:
DOMINO_TESTS_ENVIRONMENT: github
PIECE_SECRET_1: ${{ secrets.PIECE_SECRET_1 }}
run: |
pytest --cov=pieces --cov-report=xml --cov-report=term-missing
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Publish images
env:
GHCR_USERNAME: ${{ github.actor }}
run: domino piece publish-images --registry-token ${{ secrets.GITHUB_TOKEN }}
- name: Commit files
id: commit_files
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
GIT_STATUS=$(git status -s)
if [[ ! -z "$GIT_STATUS" ]]; then
git add .domino/* && git commit -m "auto-organize" -a
echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
else
echo "No changes to commit"
echo "commit_sha=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Create Release
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
domino piece delete-release --tag-name=development
domino piece release --tag-name=development --commit-sha=$commit_sha