Skip to content

Commit

Permalink
Merge branch 'master' into feature/eof-support
Browse files Browse the repository at this point in the history
  • Loading branch information
harkal committed Jun 25, 2024
2 parents 25b0cee + e9db8d9 commit d9a33ae
Show file tree
Hide file tree
Showing 591 changed files with 46,476 additions and 24,639 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### Commit message

Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see [our commit message style guide](../../blob/master/docs/style-guide.rst#best-practices-1) for what we would ideally like to see in a commit message.)
Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see [our commit message style guide](../../master/docs/style-guide.rst#best-practices-1) for what we would ideally like to see in a commit message.)

### Description for the changelog

Expand Down
56 changes: 48 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Artifacts
name: Build artifacts

on:
workflow_dispatch:
inputs:
tag:
default: ''
push:
tags:
- '*'
branches:
- master
pull_request:
release:
types: [published] # releases and pre-releases (release candidates)

defaults:
run:
Expand All @@ -23,25 +24,26 @@ jobs:
os: [ubuntu-20.04, macos-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
# grab the commit passed in via `tag`, if any
ref: ${{ github.event.inputs.tag }}
# need to fetch unshallow so that setuptools_scm can infer the version
fetch-depth: 0

- name: Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"

- name: Generate Binary
run: >-
pip install . &&
pip install --no-binary pycryptodome --no-binary cbor2 . &&
pip install pyinstaller &&
make freeze
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
Expand All @@ -51,15 +53,15 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
# grab the commit passed in via `tag`, if any
ref: ${{ github.event.inputs.tag }}
# need to fetch unshallow so that setuptools_scm can infer the version
fetch-depth: 0

- name: Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
Expand All @@ -74,3 +76,41 @@ jobs:
uses: actions/upload-artifact@v3
with:
path: dist/vyper.*

publish-release-assets:
needs: [windows-build, unix-build]
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
path: artifacts/

- name: Upload assets
# fun - artifacts are downloaded into "artifact/".
# TODO: this needs to be tested when upgrading to upload-artifact v4
working-directory: artifacts/artifact
run: |
set -Eeuxo pipefail
for BIN_NAME in $(ls)
do
curl -L \
--no-progress-meter \
-X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\
-H "Content-Type: application/octet-stream" \
"https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=${BIN_NAME/+/%2B}" \
--data-binary "@${BIN_NAME}"
done
# check build success for pull requests
build-success:
if: always()
runs-on: ubuntu-latest
needs: [windows-build, unix-build]
steps:
- name: check that all builds succeeded
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: python
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:python"
44 changes: 32 additions & 12 deletions .github/workflows/era-tester.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: era compiler tester
name: Era compiler tester

# run the matter labs compiler test to integrate their test cases
# this is intended as a diagnostic / spot check to check that we
Expand Down Expand Up @@ -27,22 +27,22 @@ jobs:
echo "ERA_VYPER_HASH=$( curl -u "u:${{ github.token }}" https://api.github.com/repos/matter-labs/era-compiler-vyper/git/ref/heads/main | jq .object.sha | tr -d '"' )" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Rust setup
uses: actions-rs/toolchain@v1
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2022-11-03

- name: Set up Python ${{ matrix.python-version[0] }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version[0] }}
cache: "pip"

- name: Get cache
id: get-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -64,13 +64,14 @@ jobs:
sed -i 's/ssh:\/\/git@/https:\/\//g' .gitmodules
git submodule init
git submodule update
sudo apt install cmake ninja-build clang-13 lld-13 parallel pkg-config lld
sudo apt-get update
sudo apt-get install -y cmake ninja-build clang-13 lld-13 parallel pkg-config lld
cargo install compiler-llvm-builder
zkevm-llvm clone && zkevm-llvm build
cargo build --release
- name: Save cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: steps.get-cache.outputs.cache-hit != 'true'
with:
path: |
Expand All @@ -85,14 +86,33 @@ jobs:
**/era-compiler-tester
key: ${{ runner.os }}-${{ env.ERA_HASH }}-${{ env.ERA_VYPER_HASH }}

- name: Install Vyper
- name: Build Vyper
run: |
set -Eeuxo pipefail
pip install .
echo "VYPER_VERSION=$(vyper --version | cut -f1 -d'+')" >> $GITHUB_ENV
- name: Install Vyper
run: |
mkdir era-compiler-tester/vyper-bin
echo $(which vyper)
cp $(which vyper) era-compiler-tester/vyper-bin/vyper-0.3.8
cp $(which vyper) era-compiler-tester/vyper-bin/vyper-${{ env.VYPER_VERSION }}
- name: Run tester
- name: Run tester (fast)
# Run era tester with no LLVM optimizations
continue-on-error: true
if: ${{ github.ref != 'refs/heads/master' }}
run: |
cd era-compiler-tester
cargo run --release --bin compiler-tester -- -v --path='tests/vyper/' --mode='M*B* 0.3.8'
cargo run --release --bin compiler-tester -- --path=tests/vyper/ --mode="M0B0 ${{ env.VYPER_VERSION }}"
- name: Run tester (slow)
# Run era tester across the LLVM optimization matrix
continue-on-error: true
if: ${{ github.ref == 'refs/heads/master' }}
run: |
cd era-compiler-tester
cargo run --release --bin compiler-tester -- --path=tests/vyper/ --mode="M*B* ${{ env.VYPER_VERSION }}"
- name: Mark as success
run: |
exit 0
12 changes: 5 additions & 7 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ name: Deploy docker image to ghcr

on:
push:
tags:
- '*'
branches:
- master
release:
Expand All @@ -29,12 +27,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# need to fetch unshallow so that setuptools_scm can infer the version
fetch-depth: 0

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Install python
with:
python-version: "3.11"
Expand All @@ -51,7 +49,7 @@ jobs:

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
Expand All @@ -62,14 +60,14 @@ jobs:
- name: Login to ghcr.io
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/publish.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# jobs to validate pull request well-formedness

name: Validate PR metadata

on:
pull_request:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
validate-pr:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
name: Run conventional commit checker
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/amannn/action-semantic-pull-request?tab=readme-ov-file#configuration
with:
types: |
feat
fix
chore
refactor
# ci: continuous integration
# docs: documentation
# test: test suite
# lang: language changes
# ux: language changes (UX)
# tool: integration
# ir: (old) IR/codegen changes
# codegen: lowering from vyper AST to codegen
# venom: venom changes
scopes: |
ci
build
docs
test
lang
ux
tool
ir
codegen
venom
requireScope: true
subjectPattern: '^(?![A-Z]).+$'
subjectPatternError: |
Starts with uppercase letter: '{subject}'
(Full PR title: '{title}')
# type[scope]<optional !>: subject
# use [] instead of () for aesthetics
headerPattern: '^(\w*)(?:\[([\w$.\-*/ ]*)\])?!?: (.*)$'
Loading

0 comments on commit d9a33ae

Please sign in to comment.