Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #535 #553

Merged
merged 11 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main

jobs:
benchmark:
benchmark:
name: Benchmark
runs-on:
- self-hosted
Expand All @@ -24,18 +24,21 @@ jobs:

- uses: actions/checkout@v2
with:
ref: main
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Check for runtime changes
env:
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}

id: check_runtime
if: github.event.label.name == 'needs-benchmarks'
run: .maintain/check_runtime.sh

- name: Benchmark Test
env:
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}

if: env.RUNTIME_CHECK == 1
id: run_benchmarks
run: .maintain/run_benchmarks.sh
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
# TODO: https://github.com/ComposableFi/composable/issues/535
/home/runner/.cargo/bin/cargo install -f cargo-llvm-cov
/home/runner/.cargo/bin/rustup component add llvm-tools-preview --toolchain=nightly-2021-11-08
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo +nightly-2021-11-08 llvm-cov --workspace --locked --release --verbose --features=runtime-benchmarks --exclude=integration-tests --lcov --output-path lcov.info
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo +nightly-2021-11-08 llvm-cov --workspace --locked --release --verbose --features=runtime-benchmarks --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
- uses: actions/checkout@v2
- name: Run Test
run: |
SKIP_WASM_BUILD=1 cargo test --workspace --locked --release --verbose --features=runtime-benchmarks --exclude=integration-tests
SKIP_WASM_BUILD=1 cargo test --workspace --locked --release --verbose --features=runtime-benchmarks

linters:
name: Linters
Expand Down
144 changes: 71 additions & 73 deletions .github/workflows/devnet-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,76 +13,74 @@ jobs:
group: deploy-devnet
cancel-in-progress: false
steps:
- name: Clean up
continue-on-error: true
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
docker system prune --force --all --volumes


- uses: actions/checkout@v2

- uses: google-github-actions/setup-gcloud@master
with:
service_account_key: ${{ secrets.GCP_CREDENTIALS }}
export_default_credentials: true

- uses: actions/setup-python@v2

- uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-unstable

- uses: cachix/cachix-action@v10
with:
name: composable-community
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
extraPullNames: composable-community

- name: Set env
run: |
echo "RELEASE_VERSION=$GITHUB_SHA" >> $GITHUB_ENV

- name: Push artifact
run: |
/home/runner/.cargo/bin/cargo build --release
tar -czvf composable-picasso-${{ env.RELEASE_VERSION }}.tar.gz target/release/composable
gsutil mv *.tar.gz gs://composable-binaries/community-releases/picasso/

- name: Load state
run: |
cd nix

echo $(cat devnet.json | jq --arg version "${{ env.RELEASE_VERSION }}" '.composable.version = $version' | jq --arg hash "$(nix-prefetch-url https://storage.googleapis.com/composable-binaries/community-releases/picasso/composable-picasso-${{ env.RELEASE_VERSION }}.tar.gz)" '.composable.hash = $hash') > devnet.json

jq --null-input --arg client_email "$GCP_DEVNET_SERVICE_ACCOUNT" --arg project_id "$GCP_PROJECT_ID" --arg key "\"$GCP_DEVNET_SERVICE_ACCOUNT_KEY\"" '{ "project_id": $project_id, "private_key": ($key | fromjson), "client_email": $client_email }' > ops.json

if gsutil -q stat $NIXOPS_STATE_URL/$NIXOPS_STATE;
then
gsutil cp $NIXOPS_STATE_URL/$NIXOPS_STATE $NIXOPS_STATE
else
nix develop .#deploy --impure --command nixops create -d devnet-gce
fi
env:
NIXOPS_STATE_URL: "gs://composable-state"
NIXOPS_STATE: "deployment.nixops"
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
GCP_DEVNET_SERVICE_ACCOUNT: ${{ secrets.GCP_DEVNET_SERVICE_ACCOUNT }}
GCP_DEVNET_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_DEVNET_SERVICE_ACCOUNT_KEY }}

- name: Deploy
run: |
cd nix
nix develop .#deploy --impure --command nixops deploy --check --confirm -d devnet-gce
env:
NIXOPS_STATE: "deployment.nixops"

- name: Store state
if: always()
run: |
cd nix
gsutil cp $NIXOPS_STATE $NIXOPS_STATE_URL/
env:
NIXOPS_STATE: "deployment.nixops"
NIXOPS_STATE_URL: "gs://composable-state"

- name: Clean up
continue-on-error: true
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
docker system prune --force --all --volumes

- uses: actions/checkout@v2

- uses: google-github-actions/setup-gcloud@master
with:
service_account_key: ${{ secrets.GCP_CREDENTIALS }}
export_default_credentials: true

- uses: actions/setup-python@v2

- uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-unstable

- uses: cachix/cachix-action@v10
with:
name: composable-community
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
extraPullNames: composable-community

- name: Set env
run: |
echo "RELEASE_VERSION=$GITHUB_REF_NAME" >> $GITHUB_ENV

- name: Push artifact
run: |
/home/runner/.cargo/bin/cargo build --release
tar -czvf composable-picasso-${{ env.RELEASE_VERSION }}.tar.gz target/release/composable
gsutil mv *.tar.gz gs://composable-binaries/community-releases/picasso/

- name: Load state
run: |
cd nix

echo $(cat devnet.json | jq --arg version "${{ env.RELEASE_VERSION }}" '.composable.version = $version' | jq --arg hash "$(nix-prefetch-url https://storage.googleapis.com/composable-binaries/community-releases/picasso/composable-picasso-${{ env.RELEASE_VERSION }}.tar.gz)" '.composable.hash = $hash') > devnet.json

jq --null-input --arg client_email "$GCP_DEVNET_SERVICE_ACCOUNT" --arg project_id "$GCP_PROJECT_ID" --arg key "\"$GCP_DEVNET_SERVICE_ACCOUNT_KEY\"" '{ "project_id": $project_id, "private_key": ($key | fromjson), "client_email": $client_email }' > ops.json

if gsutil -q stat $NIXOPS_STATE_URL/$NIXOPS_STATE;
then
gsutil cp $NIXOPS_STATE_URL/$NIXOPS_STATE $NIXOPS_STATE
else
nix develop .#deploy --impure --command nixops create -d devnet-gce
fi
env:
NIXOPS_STATE_URL: "gs://composable-state"
NIXOPS_STATE: "deployment.nixops"
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
GCP_DEVNET_SERVICE_ACCOUNT: ${{ secrets.GCP_DEVNET_SERVICE_ACCOUNT }}
GCP_DEVNET_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_DEVNET_SERVICE_ACCOUNT_KEY }}

- name: Deploy
run: |
cd nix
nix develop .#deploy --impure --command nixops deploy --check --confirm -d devnet-gce
env:
NIXOPS_STATE: "deployment.nixops"

- name: Store state
if: always()
run: |
cd nix
gsutil cp $NIXOPS_STATE $NIXOPS_STATE_URL/
env:
NIXOPS_STATE: "deployment.nixops"
NIXOPS_STATE_URL: "gs://composable-state"
102 changes: 0 additions & 102 deletions .github/workflows/release-drafter.yml

This file was deleted.

Loading