From 7fb18b1337ed0819f2f35ce81dc405a2836cbda2 Mon Sep 17 00:00:00 2001 From: krlosMata Date: Mon, 22 Jul 2024 13:10:58 +0200 Subject: [PATCH] codeowners & update gha actions versions --- .github/CODEOWNERS | 5 ++ .github/workflows/build-docker.yml | 102 ++++++++++++++--------------- .github/workflows/compile.yml | 32 +++++++++ .github/workflows/main.yml | 45 +++++++------ 4 files changed, 110 insertions(+), 74 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/compile.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..b45af66d7 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,5 @@ +# global owner +* @invocamanman + +# src owners +/contracts/ @invocamanman @krlosMata @ignasirv @laisolizq \ No newline at end of file diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 84f77df6c..5ebfa474d 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -4,57 +4,57 @@ name: Build-Docker image on: - push: - branches: [main] + push: + branches: [main] jobs: - build: - runs-on: ubuntu-latest + build: + runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16.x] + strategy: + matrix: + node-version: [16.x] - steps: - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Set int-bot SSH key - run: | - touch /tmp/ssh-key - echo "${{ secrets.INT_BOT_SSH_KEY }}" > /tmp/ssh-key - chmod 400 /tmp/ssh-key - eval "$(ssh-agent -s)" - ssh-add /tmp/ssh-key - - name: Checkout code - uses: actions/checkout@v2 - - name: setup - run: | - eval "$(ssh-agent -s)" - ssh-add /tmp/ssh-key - npm i - sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - sudo chmod +x /usr/local/bin/docker-compose - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build docker - run: npm run docker:contracts - - name: Push docker image - run: npm run push:docker:contracts - # Steps to push multi-platform image, it relies on the previous step: - # npm run docker:contracts - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Build and push - uses: docker/build-push-action@v2 - with: - platforms: linux/amd64,linux/arm64 - push: true - tags: hermeznetwork/geth-zkevm-contracts:1.5-integration - file: docker/Dockerfile - context: . + steps: + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - name: Set int-bot SSH key + run: | + touch /tmp/ssh-key + echo "${{ secrets.INT_BOT_SSH_KEY }}" > /tmp/ssh-key + chmod 400 /tmp/ssh-key + eval "$(ssh-agent -s)" + ssh-add /tmp/ssh-key + - name: Checkout code + uses: actions/checkout@v3 + - name: setup + run: | + eval "$(ssh-agent -s)" + ssh-add /tmp/ssh-key + npm i + sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build docker + run: npm run docker:contracts + - name: Push docker image + run: npm run push:docker:contracts + # Steps to push multi-platform image, it relies on the previous step: + # npm run docker:contracts + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Build and push + uses: docker/build-push-action@v2 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: hermeznetwork/geth-zkevm-contracts:1.5-integration + file: docker/Dockerfile + context: . diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 000000000..0706e43ab --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,32 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Main CI + +on: + push: + branches: [feature/ongoingPP] + pull_request: + branches: [feature/ongoingPP] + +jobs: + lint-and-test: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + steps: + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - name: Checkout code + uses: actions/checkout@v3 + - name: setup + run: npm i + - name: linter + run: npm run lint + - name: compile + run: npm run compile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9a594a59c..2e004f443 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,30 +4,29 @@ name: Main CI on: - push: - branches: [main, develop] - pull_request: - branches: [main, develop] + push: + branches: [main, develop] + pull_request: + branches: [main, develop] jobs: - lint-and-test: - runs-on: ubuntu-latest + lint-and-test: + runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16.x] + strategy: + matrix: + node-version: [16.x] - steps: - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Checkout code - uses: actions/checkout@v2 - - name: setup - run: npm i - - name: linter - run: npm run lint - - name: test - run: npm run test - \ No newline at end of file + steps: + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - name: Checkout code + uses: actions/checkout@v3 + - name: setup + run: npm i + - name: linter + run: npm run lint + - name: test + run: npm run test