-
Notifications
You must be signed in to change notification settings - Fork 13
57 lines (44 loc) · 1.58 KB
/
main.yaml
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
name: Continuous integration
on:
push:
jobs:
main:
runs-on: ubuntu-22.04
name: Continuous integration
timeout-minutes: 15
if: "!startsWith(github.event.head_commit.message, '[skip ci] ')"
env:
REDIS_URL: redis://localhost:6379
steps:
- uses: actions/checkout@v1
- uses: camptocamp/initialise-gopass-summon-action@v2
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
patterns: pypi docker
if: github.repository == 'camptocamp/tilecloud-chain'
- run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- run: python3 -m pip install --user --requirement=ci/requirements.txt
- name: Checks
run: c2cciutils-checks
- name: Build
run: |
python setup.py --long-description > PYPI.md
docker build --tag=camptocamp/tilecloud-chain:tests --target=tests .
docker build --tag=camptocamp/tilecloud-chain .
git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '`
- name: Test
run: |
docker-compose up -d
# Wait for DB to be up
while ! docker-compose exec -T test psql -h db -p 5432 -U postgres -v ON_ERROR_STOP=1 -c "SELECT 1" -d tests
do
echo "Waiting for DB to be UP"
sleep 1
done
docker-compose exec -T test pytest
- run: docker-compose logs
if: always()
- run: docker-compose down
- name: Publish
run: c2cciutils-publish