Skip to content

Use test token

Use test token #409

Workflow file for this run

name: Python package
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v3
- name: Extract repository name which is also our primary package name
run: echo "REPO_NAME=$(basename $GITHUB_REPOSITORY)" >> $GITHUB_ENV
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
- 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: Setup upterm session
# uses: lhotari/action-upterm@v1
# with:
# ## limits ssh access and adds the ssh public key for the user which triggered the workflow
# limit-access-to-actor: true
# ## limits ssh access and adds the ssh public keys of the listed GitHub users
# limit-access-to-users: dvershinin
- name: Test with pytest
run: |
pytest -v -n auto --cov=$REPO_NAME --cov-report=xml
env:
LASTVERSION_GITHUB_API_TOKEN: ${{ secrets.LASTVERSION_GITHUB_API_TOKEN }}
- name: Upload coverage to Codacy
run: |
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
- name: Update .spec files
run: |
# ensure changelog is generated
echo "%packager Dick Solomon <[email protected]>" >> ~/.rpmmacros
cd tests
lastversion brotli.spec
lastversion nginx-module-immutable.spec
if lastversion libmozjpeg.spec; then
exit 1
fi
rm -rf libmozjpeg.spec
env:
LASTVERSION_GITHUB_API_TOKEN: ${{ secrets.LASTVERSION_GITHUB_API_TOKEN }}
- name: 'Upload brotli.spec artifact'
uses: actions/upload-artifact@v3
with:
name: brotli.spec
path: tests/brotli.spec
- name: 'Upload nginx-module-immutable.spec artifact'
uses: actions/upload-artifact@v3
with:
name: nginx-module-immutable.spec
path: tests/nginx-module-immutable.spec
build-brotli-rpm:
needs: build
runs-on: ubuntu-20.04
container: getpagespeed/rpmbuilder:centos-8
steps:
- name: Download a single artifact
uses: actions/download-artifact@v2
with:
name: brotli.spec
- name: Build updated spec
run: |
mkdir -p /github/home/rpmbuild/{SOURCES,SPECS}/
mv *.spec /sources/
build
build-nginx-module-immutable-rpm:
needs: build
runs-on: ubuntu-20.04
container: getpagespeed/rpmbuilder:centos-8
steps:
- name: Download a single artifact
uses: actions/download-artifact@v2
with:
name: nginx-module-immutable.spec
- name: Build updated spec
run: |
mkdir -p /github/home/rpmbuild/{SOURCES,SPECS}/
mv *.spec /sources/
yum -y install nginx-devel
build