From 41c9637b689b7cf9f2e200743f66e68cb781f006 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Thu, 31 Oct 2024 16:21:41 +0100 Subject: [PATCH] [ci] Move from Gitlab to Github --- .github/workflows/calc.yml | 8 +++++-- .github/workflows/e2e.yml | 37 +++++++++++++++++++++++++++++++++ .github/workflows/pr.yml | 38 +++++++++++++++++++--------------- .github/workflows/semantic.yml | 8 +++++-- 4 files changed, 70 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/e2e.yml diff --git a/.github/workflows/calc.yml b/.github/workflows/calc.yml index bcd5c2e12..6218812e1 100644 --- a/.github/workflows/calc.yml +++ b/.github/workflows/calc.yml @@ -2,9 +2,13 @@ name: calc on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: build: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 000000000..66957539a --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,37 @@ +name: E2E Tests + +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + e2e: + name: e2e + runs-on: ubuntu-latest + container: + image: node:18 + strategy: + matrix: + include: + - chain-name: westend + chain-url: wss://westend-rpc.polkadot.io + - chain-name: kusama + chain-url: wss://apps-kusama-rpc.polkadot.io + - chain-name: polkadot + chain-url: wss://apps-rpc.polkadot.io + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: e2e tests + run: | + yarn --immutable + echo "Tests for ${{ matrix.chain-name }}" + yarn test:latest-e2e-tests --log-level info --chain ${{ matrix.chain-name }} --local ${{ matrix.chain-url }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8151bbf4f..d0401cd5c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -8,6 +8,10 @@ on: branches: - master +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: lint: # The type of runner that the job will run on @@ -21,7 +25,7 @@ jobs: - name: Install Node v18 uses: actions/setup-node@v4 with: - node-version: '18.14' + node-version: "18.14" - name: Get yarn cache directory path id: yarn-cache-dir-path @@ -41,7 +45,7 @@ jobs: - name: Linter. run: yarn lint tests: - # The type of runner that the job will run on + # The type of runner that the job will run on runs-on: ubuntu-latest steps: @@ -51,7 +55,7 @@ jobs: - name: Install Node v18 uses: actions/setup-node@v4 with: - node-version: '18.14' + node-version: "18.14" - name: Get yarn cache directory path id: yarn-cache-dir-path @@ -82,7 +86,7 @@ jobs: - name: Install Node v18 uses: actions/setup-node@v4 with: - node-version: '18.14' + node-version: "18.14" - name: Get yarn cache directory path id: yarn-cache-dir-path @@ -113,7 +117,7 @@ jobs: - name: Install Node v18 uses: actions/setup-node@v4 with: - node-version: '18.14' + node-version: "18.14" - name: Get yarn cache directory path id: yarn-cache-dir-path @@ -134,11 +138,11 @@ jobs: run: yarn build:docs build-npm-release: - # This test is to make sure sidecar can release a binary without any errors. - # This script does not publish a release, but instead uses yarn to create a tarball and - # install it locally. Once installed a binary is attached to sidecars node_modules, and that - # binary is then tested against. For more in depth information reference the docs at - # `../../scripts/README.md`. + # This test is to make sure sidecar can release a binary without any errors. + # This script does not publish a release, but instead uses yarn to create a tarball and + # install it locally. Once installed a binary is attached to sidecars node_modules, and that + # binary is then tested against. For more in depth information reference the docs at + # `../../scripts/README.md`. runs-on: ubuntu-latest @@ -147,10 +151,10 @@ jobs: node-version: [18.x] steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - run: yarn - - run: yarn test:test-release + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - run: yarn + - run: yarn test:test-release diff --git a/.github/workflows/semantic.yml b/.github/workflows/semantic.yml index c01e94a51..2dccdfc22 100644 --- a/.github/workflows/semantic.yml +++ b/.github/workflows/semantic.yml @@ -13,11 +13,15 @@ on: - opened - edited - synchronize - + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: validate-title: permissions: - pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs + pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs name: Validate PR Title runs-on: ubuntu-latest steps: