forked from crypto-org-chain/cronos
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: testground image not pushed to registry
Solution: - push to github container registry
- Loading branch information
Showing
8 changed files
with
145 additions
and
363 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Push Testground Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "v*.*.*" | ||
|
||
env: | ||
IMAGE_NAME: testground-testcase | ||
|
||
jobs: | ||
|
||
push: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v23 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-22.11 | ||
extra_nix_config: | | ||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | ||
- uses: cachix/cachix-action@v12 | ||
with: | ||
name: cronos | ||
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" | ||
- name: build and push image | ||
run: | | ||
REPO_NAME=${{ github.event.repository.name }} | ||
TAG=${{ github.ref_name }} | ||
OCI_ARCHIVE=$(nix build --no-link --print-out-paths .#testground-image) | ||
echo $REPO_NAME $TAG $OCI_ARCHIVE | ||
skopeo --insecure-policy copy --dest-creds="${REPO_NAME}:${{ secrets.GITHUB_TOKEN }}" "docker-archive:${OCI_ARCHIVE}" "docker://${REPO_NAME}/testground-image:${TAG}" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ lib, poetry2nix, python311, nix-gitignore }: | ||
let | ||
overrides = poetry2nix.overrides.withDefaults | ||
(self: super: | ||
let | ||
buildSystems = { | ||
pystarport = [ "poetry-core" ]; | ||
durations = [ "setuptools" ]; | ||
multitail2 = [ "setuptools" ]; | ||
docker = [ "hatchling" "hatch-vcs" ]; | ||
pyunormalize = [ "setuptools" ]; | ||
}; | ||
in | ||
lib.mapAttrs | ||
(attr: systems: super.${attr}.overridePythonAttrs | ||
(old: { | ||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ map (a: self.${a}) systems; | ||
})) | ||
buildSystems | ||
); | ||
in | ||
poetry2nix.mkPoetryApplication { | ||
projectDir = nix-gitignore.gitignoreSourcePure [ | ||
"/*" # ignore all, then add whitelists | ||
"!/benchmark/" | ||
"!poetry.lock" | ||
"!pyproject.toml" | ||
] ../testground/benchmark; | ||
python = python311; | ||
inherit overrides; | ||
} | ||
|
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ dockerTools, cronos-matrix, test-env, testground-testcase }: | ||
dockerTools.buildLayeredImage { | ||
name = "cronos-testground"; | ||
contents = [ | ||
testground-testcase | ||
test-env | ||
cronos-matrix.cronosd | ||
]; | ||
config = { | ||
Expose = [ 9090 26657 26656 1317 26658 26660 26659 30000 ]; | ||
Cmd = [ "/bin/testground-testcase" ]; | ||
Env = [ | ||
"PYTHONUNBUFFERED=1" | ||
]; | ||
}; | ||
} |
Oops, something went wrong.