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

chore(ci): update workflow actions #499

Merged
merged 1 commit into from
Oct 13, 2022
Merged
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
10 changes: 5 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
python-version: '3.10'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Prepare tags
id: prep
shell: python
Expand Down Expand Up @@ -110,13 +110,13 @@ jobs:
install: true
driver-opts: network=host
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
if: steps.prep.outputs.login-dockerhub
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
if: steps.prep.outputs.login-ghcr
with:
registry: ghcr.io
Expand All @@ -131,7 +131,7 @@ jobs:
restore-keys: |
${{ runner.os }}-buildx-${{ matrix.python-impl }}${{ matrix.python-version }}-refs/heads/master-
- name: Build and export to Docker
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: ${{ steps.prep.outputs.dockerfile }}
Expand All @@ -144,7 +144,7 @@ jobs:
- name: Test image
run: docker run --rm ${{ env.TEST_TAG }} quick_test --data / --testnet
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
continue-on-error: ${{ matrix.python-impl == 'pypy' }} # PyPy is not first-class and has been causing some build failures
with:
context: .
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
# available OS's: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
'os': ['ubuntu-22.04', 'macos-12', 'windows-2022'],
'include': [
{'os': 'ubuntu-20.04', 'python': '3.8'},
jansegre marked this conversation as resolved.
Show resolved Hide resolved
# XXX: tests fail on these, not sure why, when running them individually each on passes, but not on `make tests`
# {'os': 'ubuntu-22.04', 'python': 'pypy-3.8'},
# {'os': 'ubuntu-22.04', 'python': 'pypy-3.9'},
Expand All @@ -34,7 +33,7 @@ jobs:
# this is the fastest one:
reduced_matrix = {
'python': ['3.9'],
'os': ['ubuntu-20.04'],
'os': ['ubuntu-22.04'],
}
github_repository = os.environ['GITHUB_REPOSITORY']
if github_repository.lower() == 'hathornetwork/hathor-core':
Expand Down Expand Up @@ -65,11 +64,14 @@ jobs:
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install Poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: 'poetry'
- name: Install Ubuntu dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
Expand All @@ -81,14 +83,10 @@ jobs:
brew cleanup -q
brew update -q
brew install -q graphviz rocksdb
- name: Install Poetry
run: |
pip --no-input --no-cache-dir install --upgrade pip wheel
pip --no-input --no-cache-dir install poetry
- name: Install Poetry dependencies
run: poetry install -n --no-root
- name: Cache mypy
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .mypy_cache
# this key is setup such that every branch has its cache and new branches can reuse dev's cache, but not the other way around
Expand All @@ -101,5 +99,5 @@ jobs:
- name: Run tests
run: poetry run make tests
- name: Upload coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
if: matrix.python == 3.9 && startsWith(matrix.os, 'ubuntu')
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN pip --no-input --no-cache-dir install --upgrade pip wheel poetry
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
WORKDIR /app/
COPY pyproject.toml poetry.lock ./
RUN poetry install -n -E sentry --no-root --no-dev
RUN poetry install -n -E sentry --no-root --only=main
COPY hathor ./hathor
COPY README.md ./
RUN poetry build -f wheel
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.pypy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN pip --no-input --no-cache-dir install --upgrade pip wheel poetry
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
WORKDIR /app/
COPY pyproject.toml poetry.lock ./
RUN poetry install -n -E sentry --no-root --no-dev
RUN poetry install -n -E sentry --no-root --only=main
COPY hathor ./hathor
COPY README.md ./
RUN poetry build -f wheel
Expand Down