Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Python version reverted #338

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Agent package

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v3
with:
python-version: 3.7
- name: fmt
run: |
make -e setup build
test -z "$(go fmt ./pkg/...)"
tests:
runs-on: ubuntu-latest
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v2
with:
go-version: '1.13'
check-latest: true
- name: Set up Python 3.7
uses: actions/setup-python@v3
with:
python-version: 3.7
- name: hadolint
run: |
make -e setup build
make -e lint
for f in `find scripts/dockerfiles -type f`; do echo $f; docker run --rm -i hadolint/hadolint:v2.1.0 < $f; done
- name: coveralls
id: make_coverall
run: |
make -e cover COVER_FILE=coverage.txt
- name: post coverall
if: steps.make_coverall.outcome == 'success'
run: |
go get github.com/mattn/goveralls
goveralls -coverprofile=coverage.txt -service=github
- name: acceptance test
run: |
pip install -r ./tests/acceptance/requirements.txt
make -e setup build
MYHOST="http://localhost:8080" make test-acceptance
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ jobs:
os: linux
dist: xenial
language: python
python: "3.9"
python: "3.7"
install:
- pip install -r tests/acceptance/requirements.txt
- python3.7 -m pip install pip==21.3.1
- pip --version
- python3.7 -m pip install -r tests/acceptance/requirements.txt
script:
- MYHOST="http://localhost:8080" make test-acceptance

Expand Down
4 changes: 2 additions & 2 deletions scripts/dockerfiles/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ ARG GO_VERSION
FROM golang:$GO_VERSION-alpine3.10 as builder
# hadolint ignore=DL3018
RUN addgroup -S agentgroup && adduser -S agentuser -G agentgroup
RUN apk add --no-cache make gcc libc-dev git curl
RUN apk add --no-cache make=4.2.1-r2 gcc=8.3.0-r0 libc-dev=0.7.1-r0 git=2.22.5-r0 curl=7.66.0-r4
WORKDIR /go/src/github.com/optimizely/agent
COPY . .
RUN make setup build

FROM alpine:3.10
RUN apk add --no-cache ca-certificates
RUN apk add --no-cache cca-certificates=20191127-r2
COPY --from=builder /go/src/github.com/optimizely/agent/bin/optimizely /optimizely
COPY --from=builder /etc/passwd /etc/passwd
USER agentuser
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest>=5.3.2
pytest-clarity>=0.2.0a1
pytest-clarity==1.0.1
requests>=2.22.0
openapi_core>=0.13.4