Skip to content

Commit 0456280

Browse files
committed
first commit
0 parents  commit 0456280

File tree

29 files changed

+1140
-0
lines changed

29 files changed

+1140
-0
lines changed

.dockerignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Include any files or directories that you don't want to be copied to your
2+
# container here (e.g., local build artifacts, temporary files, etc.).
3+
#
4+
# For more help, visit the .dockerignore file reference guide at
5+
# https://docs.docker.com/engine/reference/builder/#dockerignore-file
6+
7+
**/.DS_Store
8+
**/__pycache__
9+
**/.venv
10+
**/.classpath
11+
**/.dockerignore
12+
**/.env
13+
**/.git
14+
**/.gitignore
15+
**/.project
16+
**/.settings
17+
**/.toolstarget
18+
**/.vs
19+
**/.vscode
20+
**/*.*proj.user
21+
**/*.dbmdl
22+
**/*.jfm
23+
**/charts
24+
**/docker-compose*
25+
**/compose*
26+
**/Dockerfile*
27+
**/node_modules
28+
**/npm-debug.log
29+
**/obj
30+
**/secrets.dev.yaml
31+
**/values.dev.yaml
32+
LICENSE
33+
README.md
34+
/target/

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "cargo"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
labels:
13+
- "dependencies"
14+
15+
- package-ecosystem: "github-actions"
16+
directory: "/"
17+
schedule:
18+
interval: "weekly"
19+
labels:
20+
- "dependencies"

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
push:
6+
paths-ignore:
7+
- .github/**
8+
- README.md
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
fmt:
15+
name: Rustfmt
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v5
19+
- uses: dtolnay/rust-toolchain@nightly
20+
with:
21+
components: rustfmt
22+
- uses: taiki-e/install-action@just
23+
- uses: Swatinem/rust-cache@v2
24+
- name: Check formatting
25+
run: just check-fmt
26+
27+
clippy:
28+
name: Clippy
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v5
32+
- uses: dtolnay/rust-toolchain@stable
33+
- uses: taiki-e/install-action@just
34+
- uses: Swatinem/rust-cache@v2
35+
- name: Linting
36+
run: just clippy
37+
38+
build:
39+
name: Build
40+
runs-on: ${{ matrix.os }}
41+
strategy:
42+
matrix:
43+
os: [ubuntu-latest, macos-latest, windows-latest]
44+
steps:
45+
- uses: actions/checkout@v5
46+
- uses: dtolnay/rust-toolchain@stable
47+
- uses: taiki-e/install-action@just
48+
- uses: Swatinem/rust-cache@v2
49+
- name: Build the project
50+
run: just build
51+
52+
test:
53+
name: Test
54+
runs-on: ${{ matrix.os }}
55+
strategy:
56+
matrix:
57+
os: [ubuntu-latest, macos-latest, windows-latest]
58+
steps:
59+
- uses: actions/checkout@v5
60+
with:
61+
submodules: true
62+
- uses: dtolnay/rust-toolchain@stable
63+
- uses: taiki-e/install-action@just
64+
- uses: Swatinem/rust-cache@v2
65+
- name: Test the project
66+
run: just test

.github/workflows/docker.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Build & Publish Images
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9]+.*
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
env:
13+
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/solana-voting-program-tester
14+
15+
jobs:
16+
build:
17+
name: Build Image
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
- platform: linux/amd64
24+
os: ubuntu-latest
25+
- platform: linux/arm64
26+
os: ubuntu-22.04-arm
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v5
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: Login to GitHub Container Registry
35+
uses: docker/login-action@v3
36+
with:
37+
registry: ghcr.io
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Extract metadata (tags, labels) for Docker
42+
id: meta
43+
uses: docker/metadata-action@v5
44+
with:
45+
images: ${{ env.IMAGE_NAME }}
46+
47+
- name: Build and push image by digest
48+
id: build
49+
uses: docker/build-push-action@v6
50+
with:
51+
context: .
52+
platforms: ${{ matrix.platform }}
53+
labels: ${{ steps.meta.outputs.labels }}
54+
outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
55+
provenance: false
56+
cache-from: type=gha
57+
cache-to: type=gha
58+
59+
- name: Export digest
60+
run: |
61+
mkdir -p /tmp/digests
62+
digest="${{ steps.build.outputs.digest }}"
63+
touch "/tmp/digests/${digest#sha256:}"
64+
echo "DIGEST=${digest#sha256:}" >> $GITHUB_ENV
65+
66+
- name: Upload digests
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: digests-${{ env.DIGEST }}
70+
path: /tmp/digests/*
71+
if-no-files-found: error
72+
retention-days: 1
73+
74+
merge:
75+
name: Merge digests
76+
runs-on: ubuntu-latest
77+
needs: build
78+
steps:
79+
- name: Download digests
80+
uses: actions/download-artifact@v5
81+
with:
82+
path: /tmp/digests
83+
pattern: digests-*
84+
merge-multiple: true
85+
86+
- name: Set up Docker Buildx
87+
uses: docker/setup-buildx-action@v3
88+
89+
- name: Extract metadata (tags, labels) for Docker
90+
id: meta
91+
uses: docker/metadata-action@v5
92+
with:
93+
images: ${{ env.IMAGE_NAME }}
94+
95+
- name: Login to GitHub Container Registry
96+
uses: docker/login-action@v3
97+
with:
98+
registry: ghcr.io
99+
username: ${{ github.actor }}
100+
password: ${{ secrets.GITHUB_TOKEN }}
101+
102+
- name: Create manifest list and push
103+
working-directory: /tmp/digests
104+
run: |
105+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
106+
$(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *)
107+
108+
- name: Inspect image
109+
run: |
110+
docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}

.github/workflows/release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build Release Binaries
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9]+.*
7+
8+
permissions:
9+
contents: write
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
create-release:
16+
name: Create Release
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v5
20+
- uses: taiki-e/create-gh-release-action@v1
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
upload-assets:
25+
name: Upload Assets
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
matrix:
29+
include:
30+
- os: ubuntu-latest
31+
target: x86_64-unknown-linux-gnu
32+
platform: linux-amd64
33+
- os: ubuntu-latest
34+
target: aarch64-unknown-linux-gnu
35+
platform: linux-arm64
36+
- os: macos-latest
37+
target: x86_64-apple-darwin
38+
platform: darwin-amd64
39+
- os: macos-latest
40+
target: aarch64-apple-darwin
41+
platform: darwin-arm64
42+
- os: windows-latest
43+
target: x86_64-pc-windows-msvc
44+
platform: windows-amd64
45+
steps:
46+
- uses: actions/checkout@v5
47+
- name: Install cross-compilation tools
48+
uses: taiki-e/setup-cross-toolchain-action@v1
49+
with:
50+
target: ${{ matrix.target }}
51+
- uses: taiki-e/upload-rust-binary-action@v1
52+
with:
53+
bin: solana-voting-program-tester
54+
archive: solana-voting-program-tester-${{ matrix.platform }}
55+
target: ${{ matrix.target }}
56+
token: ${{ secrets.GITHUB_TOKEN }}
57+
include: LICENSE,README.md

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
debug
4+
target
5+
6+
# These are backup files generated by rustfmt
7+
**/*.rs.bk
8+
9+
# MSVC Windows builds of rustc generate these, which store debugging information
10+
*.pdb
11+
12+
# Generated by cargo mutants
13+
# Contains mutation testing data
14+
**/mutants.out*/
15+
16+
# RustRover
17+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
18+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
19+
# and can be added to the global gitignore or merged into this file. For a more nuclear
20+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
21+
#.idea/

0 commit comments

Comments
 (0)