-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #234 from camptocamp/github-actions
GitHub actions
- Loading branch information
Showing
13 changed files
with
131 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
|
||
name: Continuous integration | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
main: | ||
name: Continuous integration | ||
runs-on: ubuntu-18.04 | ||
timeout-minutes: 60 | ||
env: | ||
TX_USR: ${{ secrets.TX_USR }} | ||
TX_PWD: ${{ secrets.TX_PWD }} | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
steps: | ||
- name: Install packages | ||
run: sudo apt-get install -y gettext python3-virtualenv | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 10 | ||
- name: Build | ||
run: make build | ||
- name: Lint | ||
run: make check | ||
- name: Tests | ||
run: make test | ||
- name: Docker compose logs | ||
if: always() | ||
run: | | ||
docker-compose logs | ||
docker-compose down -v --remove-orphans | ||
- name: Deploy PyPI | ||
if: > | ||
github.repository == 'camptocamp/c2cgeoform' | ||
&& success() | ||
&& ( | ||
startsWith(github.ref, 'refs/tags/') | ||
) | ||
run: | | ||
sudo python3 -m pip install twine wheel | ||
scripts/deploy-pypi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM camptocamp/postgres:12 | ||
|
||
COPY docker-entrypoint-initdb.d /docker-entrypoint-initdb.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE EXTENSION postgis; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
|
||
# The project Docker compose file for development. | ||
|
||
version: '2.3' | ||
|
||
services: | ||
|
||
db: | ||
image: camptocamp/c2cgeoform-db:latest | ||
restart: unless-stopped | ||
environment: | ||
- POSTGRES_USER=www-data | ||
- POSTGRES_PASSWORD=www-data | ||
- POSTGRES_DB=c2cgeoform_demo_tests | ||
ports: | ||
- "54321:5432" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash -ex | ||
|
||
if [[ "${GITHUB_ACTIONS}" == "true" ]] | ||
then | ||
if [[ "${GITHUB_REF}" =~ ^refs/tags/.* ]] | ||
then | ||
GIT_TAGS=$(echo "${GITHUB_REF}"|sed 's|^refs/tags/||g') | ||
elif [[ "${GITHUB_REF}" =~ ^refs/heads/.* ]] | ||
then | ||
GIT_BRANCH=$(echo "${GITHUB_REF}"|sed 's|^refs/heads/||g') | ||
fi | ||
else | ||
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` | ||
GIT_TAGS=`git tag --points-at HEAD` | ||
fi | ||
|
||
function deploy_pypi { | ||
make compile-catalog | ||
VERSION=$1 python3 setup.py egg_info sdist bdist_wheel | ||
twine upload dist/* | ||
} | ||
|
||
# Deploy tags | ||
for GIT_TAG in ${GIT_TAGS} | ||
do | ||
deploy_pypi $GIT_TAG | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.