dockerize node in preparation for release #3
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: end-to-end tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-node: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install protoc compiler | |
shell: bash | |
run: | | |
sudo apt-get install -y protobuf-compiler | |
- name: Checkout Source code | |
uses: actions/checkout@v3 | |
- name: Cache cargo | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
/tmp/academy-pow/target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-v1 | |
- name: Install Rust toolchain | |
uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v1 | |
- name: build release binary | |
run: make release | |
- name: Upload binary to GH Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: academy-pow-node | |
path: /tmp/academy-pow/target//release/academy-pow-node | |
if-no-files-found: error | |
retention-days: 3 | |
- name: Build docker image | |
run: | | |
make image | |
docker save -o academy-pow.tar academy-pow-node:latest | |
- name: Upload release docker image | |
uses: actions/upload-artifact@v3 | |
with: | |
name: academy-pow-docker | |
path: academy-pow.tar | |
if-no-files-found: error | |
retention-days: 3 | |
e2e-tests: | |
needs: [build-node] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Download artifact with docker image | |
uses: actions/download-artifact@v3 | |
with: | |
name: academy-pow-docker | |
- name: Load node docker image | |
shell: bash | |
run: docker load -i academy-pow.tar | |
- name: Run two node chain | |
shell: bash | |
run: make chain & | |
- name: Verify chain responds | |
shell: bash | |
run: | | |
docker run --network host appropriate/curl:latest --retry 10 --retry-delay 3 --retry-connrefused \ | |
-H "Content-Type: application/json" -d '{ "id": 1, "jsonrpc": "2.0", "method": "rpc_methods"}' http://127.0.0.1:9933 |