Skip to content

Commit

Permalink
feature: Generate fixtures on push (#303)
Browse files Browse the repository at this point in the history
* github: Add fixture generator workflow

* workflows: fill hive fixtures from Merge

* github: rename fixtures names

* github: Rename workflows

* github: add dispatch to fixtures workflow

* github: Build fixtures on tags too

* github: Draft release on tag

* github: fix tags

* github: consolidate single workflow

* github: fixtures condition release job
  • Loading branch information
marioevz authored Sep 21, 2023
1 parent a910149 commit a08d895
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs_main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy
name: Deploy Docs Main

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_tags.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy
name: Deploy Docs Tags

on:
push:
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/fixtures.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Build and Package Fixtures

on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: 'fixtures'
evm-type: 'main'
fill-params: ''
solc: '0.8.21'
python: '3.11'
- name: 'fixtures_hive'
evm-type: 'main'
fill-params: '--enable-hive --from=Merge'
solc: '0.8.21'
python: '3.11'
- name: 'fixtures_develop'
evm-type: 'develop'
fill-params: '--until=Cancun'
solc: '0.8.21'
python: '3.11'
- name: 'fixtures_develop_hive'
evm-type: 'develop'
fill-params: '--enable-hive --from=Merge --until=Cancun'
solc: '0.8.21'
python: '3.11'
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ./.github/actions/build-evm
id: evm-builder
with:
type: ${{ matrix.evm-type }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install solc compiler
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then PLATFORM="linux-amd64"; else PLATFORM="macosx-amd64"; fi
RELEASE_NAME=$(curl https://binaries.soliditylang.org/${PLATFORM}/list.json | jq -r --arg SOLC_VERSION "${{ matrix.solc }}" '.releases[$SOLC_VERSION]')
wget -O $GITHUB_WORKSPACE/bin/solc https://binaries.soliditylang.org/${PLATFORM}/$RELEASE_NAME
chmod a+x $GITHUB_WORKSPACE/bin/solc
echo $GITHUB_WORKSPACE/bin >> $GITHUB_PATH
- name: Run fixtures fill
shell: bash
run: |
pip install --upgrade pip
python -m venv env
source env/bin/activate
pip install -e .
fill ${{ matrix.fill-params }}
- name: Create fixtures info file
shell: bash
run: |
echo -e "ref: $GITHUB_REF \ncommit: $GITHUB_SHA\nbuild: $(date +"%Y-%m-%dT%H:%M:%SZ")" \
> fixtures/info.txt
- name: Tar fixtures output
shell: bash
run: |
tar -czvf ${{ matrix.name }}.tar.gz ./fixtures
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}.tar.gz
release:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: .
- name: Draft Release
uses: softprops/action-gh-release@v1
with:
files: './**'
draft: true
generate_release_notes: true
fail_on_unmatched_files: true
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ethereum Testing Tools
name: Run Tox Verifications

on: [push, pull_request, workflow_dispatch]

Expand Down

0 comments on commit a08d895

Please sign in to comment.