chore: add check if artifact exists #83
Workflow file for this run
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
name: ci | |
on: | |
push: | |
branches: | |
- '**' | |
concurrency: | |
group: ci-${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- name: Print Go environment | |
run: go env | |
- name: Build Application | |
run: make build | |
# needs: build, in other jobs is to utilize the go cache created by build | |
lint: | |
needs: build | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- name: Run Lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.59 | |
args: --timeout=10m | |
unit-tests: | |
needs: build | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- name: Run Unit Tests | |
run: | | |
make test | |
check-mock-gen: | |
needs: build | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- name: Run make mock-gen | |
run: make mocks | |
- name: Check for uncommitted changes | |
run: | | |
if ! git diff --exit-code; then | |
echo "Uncommitted changes detected. Please run 'make mocks' before committing." | |
exit 1 | |
fi | |
############################################################################### | |
### E2E ### | |
############################################################################### | |
e2e-docker-build-babylon: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build docker babylond | |
run: | | |
make -C contrib/images babylond | |
- name: Docker save babylon | |
run: | | |
docker save -o /tmp/docker-babylond.tar.gz babylonlabs-io/babylond:latest | |
- name: Upload babylon artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: babylond-${{ github.sha }} # so it renovates at every new sha | |
path: /tmp/docker-babylond.tar.gz | |
e2e-docker-build-babylon-before-upgrade: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Artifact babylond-before-upgrade exists | |
uses: xSAVIKx/artifact-exists-action@v0 | |
id: check-babylond-before-upgrade | |
with: | |
name: babylond-before-upgrade | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build docker and save babylond-before-upgrade | |
if: steps.check-babylond-before-upgrade.outputs.exists == 'false' | |
run: | | |
make -C contrib/images babylond-before-upgrade | |
docker save -o /tmp/docker-babylond-before-upgrade.tar.gz babylonlabs-io/babylond-before-upgrade:latest | |
- name: Upload babylond-before-upgrade artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: babylond-before-upgrade | |
path: /tmp/docker-babylond-before-upgrade.tar.gz | |
e2e-docker-build-e2e-init-chain: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Artifact init-chain exists | |
uses: xSAVIKx/artifact-exists-action@v0 | |
id: check-init-chain | |
with: | |
name: init-chain | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build docker and save init-chain | |
if: steps.check-init-chain.outputs.exists == 'false' | |
run: | | |
make -C contrib/images init-chain | |
docker save -o /tmp/docker-init-chain.tar.gz babylonlabs-io/babylond-e2e-init-chain:latest | |
- name: Upload init-chain artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: init-chain | |
path: /tmp/docker-init-chain.tar.gz | |
e2e-run-ibc-transfer: | |
needs: [e2e-docker-build-babylon] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download babylon artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: babylond-${{ github.sha }} | |
path: /tmp | |
- name: Docker load babylond | |
run: | | |
docker load < /tmp/docker-babylond.tar.gz | |
- name: Login to Docker Hub # load hermes | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Run e2e TestIBCTranferTestSuite | |
run: | | |
sudo make test-e2e-cache-ibc-transfer | |
e2e-run-btc-timestamping: | |
needs: [e2e-docker-build-babylon] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download babylon artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: babylond-${{ github.sha }} | |
path: /tmp | |
- name: Docker load babylond | |
run: | | |
ls -la | |
ls -la /tmp | |
docker load < /tmp/docker-babylond.tar.gz | |
- name: Run e2e TestBTCTimestampingTestSuite | |
run: | | |
sudo make test-e2e-cache-btc-timestamping | |
e2e-run-upgrade-vanilla: | |
needs: [e2e-docker-build-babylon, e2e-docker-build-babylon-before-upgrade, e2e-docker-build-e2e-init-chain] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download babylon artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: babylond-${{ github.sha }} | |
path: /tmp | |
- name: Download babylond-before-upgrade artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: babylond-before-upgrade | |
path: /tmp | |
- name: Download init-chain artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: init-chain | |
path: /tmp | |
- name: Docker load babylond | |
run: | | |
docker load < /tmp/docker-babylond.tar.gz | |
- name: Docker load babylond-before-upgrade | |
run: | | |
docker load < /tmp/docker-babylond-before-upgrade.tar.gz | |
- name: Docker load init chain | |
run: | | |
docker load < /tmp/docker-init-chain.tar.gz | |
- name: Run e2e TestSoftwareUpgradeTestSuite | |
run: | | |
sudo make test-e2e-cache-upgrade-vanilla | |
build-run-integration-tests: | |
needs: build | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build E2E Dockers | |
run: | | |
sudo make build-docker-e2e | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- name: Run E2E Tests | |
run: | | |
sudo make test-e2e-cache |