-
-
Notifications
You must be signed in to change notification settings - Fork 808
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/vyperlang/vyper into feat…
…/remove_builtin_constants
- Loading branch information
Showing
185 changed files
with
8,252 additions
and
2,171 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
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 | ||
# haven't seriously broken the compiler. but, it is not intended as | ||
# a requirement for merging since we may make changes to our IR | ||
# which break the downstream backend (at which point, downstream needs | ||
# to update, which we do not want to be blocked on). | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
# cancel older, in-progress jobs from the same PR, same workflow. | ||
# use run_id if the job is triggered by a push to ensure | ||
# push-triggered jobs to not get canceled. | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
era-compiler-tester: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Get latest commit hash | ||
run: | | ||
echo "ERA_HASH=$( curl -u "u:${{ github.token }}" https://api.github.com/repos/matter-labs/era-compiler-tester/git/ref/heads/main | jq .object.sha | tr -d '"' )" >> $GITHUB_ENV | ||
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 | ||
|
||
- name: Rust setup | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly-2022-11-03 | ||
|
||
- name: Set up Python ${{ matrix.python-version[0] }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version[0] }} | ||
cache: "pip" | ||
|
||
- name: Get cache | ||
id: get-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
**/target | ||
**/target-llvm | ||
**/compiler_tester | ||
**/llvm | ||
**/era-compiler-tester | ||
key: ${{ runner.os }}-${{ env.ERA_HASH }}-${{ env.ERA_VYPER_HASH }} | ||
|
||
- name: Initialize repository and install dependencies | ||
if: steps.get-cache.outputs.cache-hit != 'true' | ||
run: | | ||
git clone --depth 1 https://github.com/matter-labs/era-compiler-tester.git | ||
cd era-compiler-tester | ||
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 | ||
cargo install compiler-llvm-builder | ||
zkevm-llvm clone && zkevm-llvm build | ||
cargo build --release | ||
- name: Save cache | ||
uses: actions/cache/save@v3 | ||
if: steps.get-cache.outputs.cache-hit != 'true' | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
**/target | ||
**/target-llvm | ||
**/compiler_tester | ||
**/llvm | ||
**/era-compiler-tester | ||
key: ${{ runner.os }}-${{ env.ERA_HASH }}-${{ env.ERA_VYPER_HASH }} | ||
|
||
- 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 | ||
cp $(which vyper) era-compiler-tester/vyper-bin/vyper-${{ env.VYPER_VERSION }} | ||
- 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 -- --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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Deploy docker image to ghcr | ||
|
||
# Deploy docker image to ghcr on pushes to master and all releases/tags. | ||
# Note releases to docker hub are managed separately in another process | ||
# (github sends webhooks to docker hub which triggers the build there). | ||
# This workflow is an alternative form of retention for docker images | ||
# which also allows us to tag and retain every single commit to master. | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
release: | ||
types: [released] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
deploy-ghcr: | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
# need to fetch unshallow so that setuptools_scm can infer the version | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v4 | ||
name: Install python | ||
with: | ||
python-version: "3.11" | ||
cache: "pip" | ||
|
||
- name: Generate vyper/version.py | ||
run: | | ||
pip install . | ||
echo "VYPER_VERSION=$(PYTHONPATH=. python vyper/cli/vyper_compile.py --version)" >> "$GITHUB_ENV" | ||
- name: generate tag suffix | ||
if: ${{ github.event_name != 'release' }} | ||
run: echo "VERSION_SUFFIX=-dev" >> "$GITHUB_ENV" | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=ref,event=tag | ||
type=raw,value=${{ env.VYPER_VERSION }}${{ env.VERSION_SUFFIX }} | ||
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/master' }} | ||
type=raw,value=latest,enable=${{ github.event_name == 'release' }} | ||
- name: Login to ghcr.io | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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
Oops, something went wrong.