Skip to content

Commit

Permalink
Merge branches 'fraccaman/ci-init-2' (#231) and 'ray/fix-describe-opt…
Browse files Browse the repository at this point in the history
…ions' (#232)

* fraccaman/ci-init-2:
  ci: allow ci to read docker images
  ci: correct tendermint settings for e2e tests
  ci: use anoma-owned docker images
  ci: improve python style of scripts

* ray/fix-describe-options:
  scripts: revert change to package `git describe`
  • Loading branch information
juped committed Jul 28, 2022
3 parents d403c9e + 1952331 + 5c1d274 commit 4214b01
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 63 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ concurrency:
permissions:
id-token: write
contents: read
packages: read

env:
GIT_LFS_SKIP_SMUDGE: 1
Expand All @@ -24,7 +25,7 @@ jobs:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
container:
image: ghcr.io/fraccaman/namada:wasm-0.6.1
image: ghcr.io/anoma/namada:wasm-0.6.1
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -189,8 +190,6 @@ jobs:
chmod +x target/release/namadan
chmod +x target/release/namadac
chmod +x /usr/local/bin/tendermint
- name: Set tendermint ENV for abci++ tests
run: echo "TENDERMINT=/usr/local/bin/tendermint" >> $GITHUB_ENV
- name: Run e2e test
run: make test-e2e${{ matrix.make.suffix }}
env:
Expand All @@ -199,7 +198,6 @@ jobs:
ANOMA_E2E_KEEP_TEMP: "true"
ENV_VAR_TM_STDOUT: "false"
ANOMA_LOG_COLOR: "false"
TM_LOG_LEVEL: "info"
ANOMA_LOG: "info"
- name: Upload e2e logs
if: success() || failure()
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
required: true

env:
REPOSITORY_OWNER: "fraccaman/namada"
GIT_LFS_SKIP_SMUDGE: 1

jobs:
Expand Down Expand Up @@ -53,7 +52,7 @@ jobs:
context: .
file: ${{ matrix.make.path }}/Dockerfile
push: true
tags: ghcr.io/${{ env.REPOSITORY_OWNER }}:${{ matrix.make.image }}-${{ github.event.inputs.tag }}
tags: ghcr.io/${{ github.repository }}:${{ matrix.make.image }}-${{ github.event.inputs.tag }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ matrix.make.image }}-${{ github.event.inputs.tag }}
cache-to: type=inline
1 change: 0 additions & 1 deletion .github/workflows/scripts/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import json
import subprocess
import urllib
import github3
import urllib.request
from urllib.request import urlopen

Expand Down
62 changes: 32 additions & 30 deletions .github/workflows/scripts/publish-wasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,33 +41,35 @@ def log(data: str):
pr_comment = comment_event['event']['comment']['body']
pr_number = comment_event['event']['issue']['number']

if pr_comment == PR_COMMENT:
pr_info = api.pulls.get(pr_number)
head_sha = pr_info['head']['sha']

artifacts = api.actions.list_artifacts_for_repo(per_page=ARTIFACT_PER_PAGE)

for artifact in artifacts['artifacts']:
if 'wasm' in artifact['name'] and artifact['workflow_run']['head_sha'] == head_sha and not artifact['expired']:
artifact_download_url = artifact['archive_download_url']

log("Downloading artifacts...")
curl_command_outcome = download_artifact(
artifact_download_url, TMP_DIRECTORY, TOKEN)
if curl_command_outcome.returncode != 0:
exit(1)

log("Unzipping wasm.zip...")
unzip_command_outcome = unzip(TMP_DIRECTORY)
if unzip_command_outcome.returncode != 0:
exit(1)

checksums = load(open("{}/checksums.json".format(TMP_DIRECTORY)))
for wasm in checksums.values():
log("Uploading {}...".format(wasm))
publish_wasm_command_outcome = publish_wasm(
TMP_DIRECTORY, wasm, WASM_BUCKET)
if publish_wasm_command_outcome.returncode != 0:
print("Error uploading {}!".format(wasm))

log("Done!")
if pr_comment != PR_COMMENT:
exit(0)

pr_info = api.pulls.get(pr_number)
head_sha = pr_info['head']['sha']

artifacts = api.actions.list_artifacts_for_repo(per_page=ARTIFACT_PER_PAGE)

for artifact in artifacts['artifacts']:
if 'wasm' in artifact['name'] and artifact['workflow_run']['head_sha'] == head_sha and not artifact['expired']:
artifact_download_url = artifact['archive_download_url']

log("Downloading artifacts...")
curl_command_outcome = download_artifact(
artifact_download_url, TMP_DIRECTORY, TOKEN)
if curl_command_outcome.returncode != 0:
exit(1)

log("Unzipping wasm.zip...")
unzip_command_outcome = unzip(TMP_DIRECTORY)
if unzip_command_outcome.returncode != 0:
exit(1)

checksums = load(open("{}/checksums.json".format(TMP_DIRECTORY)))
for wasm in checksums.values():
log("Uploading {}...".format(wasm))
publish_wasm_command_outcome = publish_wasm(
TMP_DIRECTORY, wasm, WASM_BUCKET)
if publish_wasm_command_outcome.returncode != 0:
print("Error uploading {}!".format(wasm))

log("Done!")
1 change: 0 additions & 1 deletion .github/workflows/scripts/udeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import json
import subprocess
import urllib
import github3
import urllib.request
from urllib.request import urlopen

Expand Down
50 changes: 26 additions & 24 deletions .github/workflows/scripts/update-wasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,34 +55,36 @@ def commit_and_push():
pr_comment = comment_event['event']['comment']['body']
pr_number = comment_event['event']['issue']['number']

if pr_comment == PR_COMMENT:
pr_info = api.pulls.get(pr_number)
head_sha = pr_info['head']['sha']
if pr_comment != PR_COMMENT:
exit(0)

pr_info = api.pulls.get(pr_number)
head_sha = pr_info['head']['sha']

artifacts = api.actions.list_artifacts_for_repo(per_page=ARTIFACT_PER_PAGE)
artifacts = api.actions.list_artifacts_for_repo(per_page=ARTIFACT_PER_PAGE)

for artifact in artifacts['artifacts']:
if 'wasm' in artifact['name'] and artifact['workflow_run']['head_sha'] == head_sha and not artifact['expired']:
artifact_download_url = artifact['archive_download_url']
for artifact in artifacts['artifacts']:
if 'wasm' in artifact['name'] and artifact['workflow_run']['head_sha'] == head_sha and not artifact['expired']:
artifact_download_url = artifact['archive_download_url']

log("Downloading artifacts...")
curl_command_outcome = download_artifact(
artifact_download_url, TMP_DIRECTORY, TOKEN)
if curl_command_outcome.returncode != 0:
exit(1)
log("Downloading artifacts...")
curl_command_outcome = download_artifact(
artifact_download_url, TMP_DIRECTORY, TOKEN)
if curl_command_outcome.returncode != 0:
exit(1)

unzip_command_outcome = unzip(TMP_DIRECTORY)
if unzip_command_outcome.returncode != 0:
exit(1)
unzip_command_outcome = unzip(TMP_DIRECTORY)
if unzip_command_outcome.returncode != 0:
exit(1)

log("Replacing checksums.json...")
replace_command_outcome = replace_checksums(TMP_DIRECTORY)
if replace_command_outcome.returncode != 0:
exit(1)
log("Replacing checksums.json...")
replace_command_outcome = replace_checksums(TMP_DIRECTORY)
if replace_command_outcome.returncode != 0:
exit(1)

log("Pushing new checksums.json...")
commit_and_push_command_outcome = commit_and_push()
if commit_and_push_command_outcome.returncode != 0:
exit(1)
log("Pushing new checksums.json...")
commit_and_push_command_outcome = commit_and_push()
if commit_and_push_command_outcome.returncode != 0:
exit(1)

log("Done!")
log("Done!")
2 changes: 1 addition & 1 deletion scripts/make-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

set -e

VERSION="$(git describe --tags)"
VERSION="$(git describe --dirty --broken)"
PLATFORM="$(uname -s)-$(uname -m)"
PACKAGE_NAME="namada-${VERSION}-${PLATFORM}"
BIN="namada namadac namadan namadaw"
Expand Down

0 comments on commit 4214b01

Please sign in to comment.