Upgrade to Python 3.11 #180
Workflow file for this run
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
name: CI | |
on: [push] | |
jobs: | |
build-and-test: | |
runs-on: | |
ubuntu-20.04 | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Build Docker image | |
run: docker build -t lyrx2sld . | |
- name: Run | |
run: docker run -d -p 80:80 lyrx2sld | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 pytest | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Run Python tests | |
run: pytest tests/tests.py -v | |
- name: Integration test | |
run: ./tests/integration_test.sh | |
publish: | |
if: ${{ github.ref == 'refs/heads/master' }} | |
runs-on: | |
ubuntu-20.04 | |
needs: | |
build-and-test | |
env: | |
PATH: /bin:/usr/bin:/usr/local/bin:/home/runner/.local/bin | |
SUMMON_PROVIDER: /usr/local/bin/gopass | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Build Docker image | |
run: docker build -t camptocamp/lyrx2sld:latest . | |
- uses: camptocamp/initialise-gopass-summon-action@v1 | |
with: | |
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}} | |
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}} | |
- run: scripts/publish-docker --image=lyrx2sld --tag=latest | |
- run: | | |
git_hash=$(git rev-parse --short "$GITHUB_SHA") | |
git_branch=${GITHUB_REF#refs/heads/} | |
docker tag camptocamp/lyrx2sld:latest camptocamp/lyrx2sld:$git_branch.$git_hash | |
scripts/publish-docker --image=lyrx2sld --tag=$git_branch.$git_hash | |