forked from GalaChain/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cache Docker images in CI (GalaChain#408)
- Loading branch information
Showing
2 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,6 +149,10 @@ jobs: | |
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Cache Docker images | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-${{ runner.os }}-${{ github.ref_name }} | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,17 +29,38 @@ jobs: | |
- name: Test | ||
run: npm run test | ||
|
||
ensure-docker-cache: | ||
name: Ensure Docker cache | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Cache Docker images | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-${{ runner.os }}-${{ github.ref_name }} | ||
- name: Prefetch Fabric Docker layers | ||
run: | | ||
cd chain-cli/network | ||
curl -Lf https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/fablo.sh -o ./fablo && chmod +x ./fablo | ||
./fablo generate fablo-config-default.json | ||
docker compose -f fablo-target/fabric-docker/docker-compose.yaml pull | ||
template-ci: | ||
name: Chaincode template CI | ||
runs-on: ubuntu-latest | ||
needs: [ci] | ||
needs: [ci, ensure-docker-cache] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- name: Cache Docker images | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-${{ runner.os }}-${{ github.ref_name }} | ||
- name: Install local CLI | ||
run: .github/scripts/install-local-cli.sh | ||
- name: Create test project | ||
|
@@ -58,7 +79,7 @@ jobs: | |
template-e2e: | ||
name: Chaincode template E2E (watch mode) | ||
runs-on: ubuntu-latest | ||
needs: [ci] | ||
needs: [ci, ensure-docker-cache] | ||
env: | ||
GALA_CLIENT_DEV_MODE: "true" | ||
steps: | ||
|
@@ -81,6 +102,10 @@ jobs: | |
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- name: Cache Docker images | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-${{ runner.os }}-${{ github.ref_name }} | ||
- name: Install local CLI | ||
run: .github/scripts/install-local-cli.sh | ||
- name: Create test project | ||
|
@@ -109,7 +134,7 @@ jobs: | |
template-e2e-rest: | ||
name: Chaincode template E2E (REST API) | ||
runs-on: ubuntu-latest | ||
needs: [ci] | ||
needs: [ci, ensure-docker-cache] | ||
env: | ||
GALA_CLIENT_DEV_MODE: "false" | ||
CURATORORG_OPS_API_URL: "http://localhost:8801" | ||
|
@@ -133,6 +158,10 @@ jobs: | |
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- name: Cache Docker images | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-${{ runner.os }}-${{ github.ref_name }} | ||
- name: Install local CLI | ||
run: .github/scripts/install-local-cli.sh | ||
- name: Create test project | ||
|
@@ -150,7 +179,7 @@ jobs: | |
|
||
template-image-check: | ||
name: Chaincode template image check | ||
needs: [ci] | ||
needs: [ci, ensure-docker-cache] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
@@ -159,6 +188,10 @@ jobs: | |
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- name: Cache Docker images | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-${{ runner.os }}-${{ github.ref_name }} | ||
- name: Install local CLI | ||
run: .github/scripts/install-local-cli.sh | ||
- name: Create test project | ||
|