Skip to content

Commit

Permalink
Code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
branlwyd committed Aug 30, 2022
1 parent e194427 commit b9b87be
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,32 @@ on:
jobs:
janus_build:
runs-on: ubuntu-latest
permissions:
id-token: "write"
contents: "read"
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
DAPHNE_INTEROP_CONTAINER: prebuilt=${{ secrets.DAPHNE_PREBUILT_IMAGE_NAME_AND_TAG }}
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v3
# See https://github.com/google-github-actions/auth#authenticating-to-container-registry-and-artifact-registry
- id: "gcp-auth"
name: "Authenticate to GCP"
uses: "google-github-actions/auth@v0"
with:
workload_identity_provider: ${{ secrets.GCP_ARTIFACT_READER_WORKFLOW_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_ARTIFACT_READER_SERVICE_ACCOUNT }}
token_format: "access_token"
access_token_lifetime: "3600s"
access_token_scopes: "https://www.googleapis.com/auth/cloud-platform"
export_environment_variables: true
- uses: "docker/login-action@v2"
with:
registry: "us-west2-docker.pkg.dev"
username: "oauth2accesstoken"
password: ${{ steps.gcp-auth.outputs.access_token }}
- name: Setup Go toolchain
uses: actions/setup-go@v3
- name: Install Kind
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push-docker-images-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# See https://github.com/google-github-actions/auth#authenticating-to-container-registry-and-artifact-registry
- id: "gcp-auth"
name: "Authenticate to GCP"
uses: "google-github-actions/auth@v0"
Expand All @@ -27,7 +28,6 @@ jobs:
access_token_lifetime: "3600s"
access_token_scopes: "https://www.googleapis.com/auth/cloud-platform"
export_environment_variables: true
# See https://github.com/google-github-actions/auth#authenticating-to-container-registry-and-artifact-registry
- uses: "docker/login-action@v2"
with:
registry: "us-west2-docker.pkg.dev"
Expand Down
6 changes: 4 additions & 2 deletions monolithic_integration_test/src/daphne.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ use std::{
use testcontainers::{core::Port, images::generic::GenericImage, Container, RunnableImage};
use tokio::{select, sync::oneshot, task, time::interval};

// test_daphne.tar.zst is generated by this package's build.rs.
// test_daphne.metadata / test_daphne.tar.zst are generated by this package's build.rs.
static TEST_DAPHNE_IMAGE_NAME_AND_TAG: Mutex<Option<(String, String)>> = Mutex::new(None);
const TEST_DAPHNE_METADATA_BYTES: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/test_daphne.metadata"));
const TEST_DAPHNE_IMAGE_BYTES: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/test_daphne.tar.zst"));
static TEST_DAPHNE_IMAGE_NAME_AND_TAG: Mutex<Option<(String, String)>> = Mutex::new(None);

/// Represents a running Daphne test instance.
pub struct Daphne {
Expand Down Expand Up @@ -146,6 +146,8 @@ impl Daphne {
.to_string(),
),

"skip" => panic!("No Daphne test image available (compiled with DAPHNE_INTEROP_CONTAINER=skip)"),

_ => panic!("Unknown Daphne test image build strategy: {strategy:?}"),
});
}
Expand Down

0 comments on commit b9b87be

Please sign in to comment.