From 8d775d767a56e1e72bfea51591a968ef0d615c74 Mon Sep 17 00:00:00 2001 From: Alex Lucaci Date: Tue, 31 Oct 2023 21:31:35 +0200 Subject: [PATCH 1/3] workflows: added bsc-integration-testing --- .github/workflows/bsc-integration-test.yml | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/bsc-integration-test.yml diff --git a/.github/workflows/bsc-integration-test.yml b/.github/workflows/bsc-integration-test.yml new file mode 100644 index 0000000000..7e76bdd2c7 --- /dev/null +++ b/.github/workflows/bsc-integration-test.yml @@ -0,0 +1,62 @@ +name: BSC Integration Test + +on: + push: + branches: + - feature/bsc-integration-testing + +jobs: + compile: + name: BSC Integration Test + runs-on: ubuntu-latest + steps: + - name: Checkout bsc-docker-deploy + uses: actions/checkout@v4 + with: + # Repository name with owner. For example, actions/checkout + # Default: ${{ github.repository }} + repository: 'bnb-chain/bsc-docker-deploy' + token: ${{ secrets.PAT }} + path: "bsc-docker-deploy" + ref: 'feature/dinamic-entrypoint' + - name: Checkout bsc-genesis-contract + uses: actions/checkout@v4 + with: + repository: 'bnb-chain/bsc-genesis-contract' + token: ${{ secrets.PAT }} + path: "bsc-docker-deploy/bsc-genesis-contract" + - name: Checkout node + uses: actions/checkout@v4 + with: + repository: 'bnb-chain/node' + token: ${{ secrets.PAT }} + path: "bsc-docker-deploy/node" + - name: Checkout bsc + uses: actions/checkout@v4 + with: + repository: 'bnb-chain/bsc' + token: ${{ secrets.PAT }} + path: "bsc-docker-deploy/bsc" + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: bsc-docker-deploy/ + tags: bnb-chain.local/bsc-integration-testing:latest + - name: Checkout bsc-integration-testing + uses: actions/checkout@v4 + with: + repository: 'bnb-chain/bsc-integration-testing' + token: ${{ secrets.PAT }} + path: "bsc-integration-testing" + - name: Setup Go 1.21 + uses: actions/setup-go@v4 + with: + go-version: "1.21" + - name: Go test with docker containers + uses: bnb-alexlucaci/go-test-docker-run-action@v2 + with: + run: | + cd bsc-integration-testing + env VOLUME_MOUNT_PATH=${{ runner.workspace }}/bsc-integration-testing/foundation/test IMAGE_NAME=bnb-chain.local/bsc-integration-testing:latest go test -v ./... From 5eeb43f117a9b7e16475debaf0bfd0973b9695c0 Mon Sep 17 00:00:00 2001 From: Alex Lucaci Date: Wed, 1 Nov 2023 16:47:16 +0200 Subject: [PATCH 2/3] workflows: bsc-integration-test fix --- .github/workflows/bsc-integration-test.yml | 34 +++++++++++++++------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/bsc-integration-test.yml b/.github/workflows/bsc-integration-test.yml index 7e76bdd2c7..be69461a0c 100644 --- a/.github/workflows/bsc-integration-test.yml +++ b/.github/workflows/bsc-integration-test.yml @@ -13,50 +13,62 @@ jobs: - name: Checkout bsc-docker-deploy uses: actions/checkout@v4 with: - # Repository name with owner. For example, actions/checkout - # Default: ${{ github.repository }} repository: 'bnb-chain/bsc-docker-deploy' - token: ${{ secrets.PAT }} + token: ${{ github.token }} path: "bsc-docker-deploy" ref: 'feature/dinamic-entrypoint' - name: Checkout bsc-genesis-contract uses: actions/checkout@v4 with: repository: 'bnb-chain/bsc-genesis-contract' - token: ${{ secrets.PAT }} + token: ${{ github.token }} path: "bsc-docker-deploy/bsc-genesis-contract" - name: Checkout node uses: actions/checkout@v4 with: repository: 'bnb-chain/node' - token: ${{ secrets.PAT }} + token: ${{ github.token }} path: "bsc-docker-deploy/node" - name: Checkout bsc uses: actions/checkout@v4 with: repository: 'bnb-chain/bsc' - token: ${{ secrets.PAT }} + token: ${{ github.token }} path: "bsc-docker-deploy/bsc" + - name: Test + run: | + ls -lah + pwd - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: login + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} - name: Build and push uses: docker/build-push-action@v5 with: + push: true context: bsc-docker-deploy/ - tags: bnb-chain.local/bsc-integration-testing:latest + tags: ghcr.io/bnb-chain/bsc-integration-testing:latest - name: Checkout bsc-integration-testing uses: actions/checkout@v4 with: repository: 'bnb-chain/bsc-integration-testing' - token: ${{ secrets.PAT }} + token: ${{ github.token }} path: "bsc-integration-testing" - name: Setup Go 1.21 uses: actions/setup-go@v4 with: go-version: "1.21" - name: Go test with docker containers - uses: bnb-alexlucaci/go-test-docker-run-action@v2 + uses: bnb-alexlucaci/go-test-docker-run-action@v3 with: + working_directory: ./bsc-integration-testing + username: bnb-alexlucaci + password: ${{ github.token }} + registry: ghcr.io run: | - cd bsc-integration-testing - env VOLUME_MOUNT_PATH=${{ runner.workspace }}/bsc-integration-testing/foundation/test IMAGE_NAME=bnb-chain.local/bsc-integration-testing:latest go test -v ./... + env VOLUME_MOUNT_PATH=${{ github.workspace }}/bsc-integration-testing/foundation/test IMAGE_NAME=ghcr.io/bnb-chain/bsc-integration-testing:latest go test -v ./... \ No newline at end of file From 655e0eb04b70a2d1122279cf07315cf16de2882e Mon Sep 17 00:00:00 2001 From: Alex Lucaci Date: Thu, 2 Nov 2023 12:40:41 +0200 Subject: [PATCH 3/3] workflows: added usage of BSC_INTEGRATION_TEST_GITHUB_TOKEN secret for github pulls --- .github/workflows/bsc-integration-test.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/bsc-integration-test.yml b/.github/workflows/bsc-integration-test.yml index be69461a0c..92da54cced 100644 --- a/.github/workflows/bsc-integration-test.yml +++ b/.github/workflows/bsc-integration-test.yml @@ -14,26 +14,26 @@ jobs: uses: actions/checkout@v4 with: repository: 'bnb-chain/bsc-docker-deploy' - token: ${{ github.token }} + token: ${{ secrets.BSC_INTEGRATION_TEST_GITHUB_TOKEN }} path: "bsc-docker-deploy" ref: 'feature/dinamic-entrypoint' - name: Checkout bsc-genesis-contract uses: actions/checkout@v4 with: repository: 'bnb-chain/bsc-genesis-contract' - token: ${{ github.token }} + token: ${{ secrets.BSC_INTEGRATION_TEST_GITHUB_TOKEN }} path: "bsc-docker-deploy/bsc-genesis-contract" - name: Checkout node uses: actions/checkout@v4 with: repository: 'bnb-chain/node' - token: ${{ github.token }} + token: ${{ secrets.BSC_INTEGRATION_TEST_GITHUB_TOKEN }} path: "bsc-docker-deploy/node" - name: Checkout bsc uses: actions/checkout@v4 with: repository: 'bnb-chain/bsc' - token: ${{ github.token }} + token: ${{ secrets.BSC_INTEGRATION_TEST_GITHUB_TOKEN }} path: "bsc-docker-deploy/bsc" - name: Test run: | @@ -46,7 +46,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ github.token }} + password: ${{ secrets.BSC_INTEGRATION_TEST_GITHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v5 with: @@ -57,7 +57,7 @@ jobs: uses: actions/checkout@v4 with: repository: 'bnb-chain/bsc-integration-testing' - token: ${{ github.token }} + token: ${{ secrets.BSC_INTEGRATION_TEST_GITHUB_TOKEN }} path: "bsc-integration-testing" - name: Setup Go 1.21 uses: actions/setup-go@v4 @@ -68,7 +68,7 @@ jobs: with: working_directory: ./bsc-integration-testing username: bnb-alexlucaci - password: ${{ github.token }} + password: ${{ secrets.BSC_INTEGRATION_TEST_GITHUB_TOKEN }} registry: ghcr.io run: | env VOLUME_MOUNT_PATH=${{ github.workspace }}/bsc-integration-testing/foundation/test IMAGE_NAME=ghcr.io/bnb-chain/bsc-integration-testing:latest go test -v ./... \ No newline at end of file