Skip to content
Draft
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
60 changes: 56 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ name: CI

on:
push:
branches: [ main, develop ]
branches: [ main, develop, test/gcp-staging-ci ]
pull_request:
branches: [ main, earlgrey-hwe ]

permissions:
contents: read
id-token: write

env:
CARGO_TERM_COLOR: always
Expand All @@ -18,7 +19,7 @@ env:
jobs:
presubmit:
name: Presubmit Checks
runs-on: openprot-ci-runner
runs-on: openprot-ci-runner-staging
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

Expand All @@ -29,6 +30,23 @@ jobs:
disk-cache: false
repository-cache: false

- name: Authenticate to GCP (WIF)
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3
with:
workload_identity_provider: projects/205490233253/locations/global/workloadIdentityPools/github-actions-pool/providers/github-oidc
service_account: ${{ github.event_name == 'push' && github.ref == 'refs/heads/test/gcp-staging-ci' && 'bazel-cache-writer@openprot-ci-staging.iam.gserviceaccount.com' || 'bazel-cache-reader@openprot-ci-staging.iam.gserviceaccount.com' }}

- name: Configure Bazel remote cache
run: |
cat <<EOF > .bazelrc-site
build --remote_cache=https://storage.googleapis.com/openprot-ci-staging-bazel-cache
build --google_default_credentials=true
build --remote_upload_local_results=${{ github.event_name == 'push' && github.ref == 'refs/heads/test/gcp-staging-ci' }}
build --experimental_remote_cache_eviction_retries=5
build --experimental_remote_cache_async
build --experimental_inprocess_symlink_creation=false
EOF

- name: Presubmit Checks
# The presubmit workflow performs formatting checks, a MODULE.bazel.lock
# up-to-date check, license checks, C/C++ include checks and clippy lints.
Expand All @@ -38,7 +56,7 @@ jobs:
test:
name: Test
needs: presubmit
runs-on: openprot-ci-runner
runs-on: openprot-ci-runner-staging
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

Expand All @@ -49,14 +67,31 @@ jobs:
disk-cache: false
repository-cache: false

- name: Authenticate to GCP (WIF)
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3
with:
workload_identity_provider: projects/205490233253/locations/global/workloadIdentityPools/github-actions-pool/providers/github-oidc
service_account: ${{ github.event_name == 'push' && github.ref == 'refs/heads/test/gcp-staging-ci' && 'bazel-cache-writer@openprot-ci-staging.iam.gserviceaccount.com' || 'bazel-cache-reader@openprot-ci-staging.iam.gserviceaccount.com' }}

- name: Configure Bazel remote cache
run: |
cat <<EOF > .bazelrc-site
build --remote_cache=https://storage.googleapis.com/openprot-ci-staging-bazel-cache
build --google_default_credentials=true
build --remote_upload_local_results=${{ github.event_name == 'push' && github.ref == 'refs/heads/test/gcp-staging-ci' }}
build --experimental_remote_cache_eviction_retries=5
build --experimental_remote_cache_async
build --experimental_inprocess_symlink_creation=false
EOF

- name: Run tests
# See workflows.json for the `ci` definition.
run: ./pw ci

build:
name: Build Targets
needs: test
runs-on: openprot-ci-runner
runs-on: openprot-ci-runner-staging

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
Expand All @@ -68,6 +103,23 @@ jobs:
disk-cache: false
repository-cache: false

- name: Authenticate to GCP (WIF)
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3
with:
workload_identity_provider: projects/205490233253/locations/global/workloadIdentityPools/github-actions-pool/providers/github-oidc
service_account: ${{ github.event_name == 'push' && github.ref == 'refs/heads/test/gcp-staging-ci' && 'bazel-cache-writer@openprot-ci-staging.iam.gserviceaccount.com' || 'bazel-cache-reader@openprot-ci-staging.iam.gserviceaccount.com' }}

- name: Configure Bazel remote cache
run: |
cat <<EOF > .bazelrc-site
build --remote_cache=https://storage.googleapis.com/openprot-ci-staging-bazel-cache
build --google_default_credentials=true
build --remote_upload_local_results=${{ github.event_name == 'push' && github.ref == 'refs/heads/test/gcp-staging-ci' }}
build --experimental_remote_cache_eviction_retries=5
build --experimental_remote_cache_async
build --experimental_inprocess_symlink_creation=false
EOF

- name: Build
# See workflows.json for the `default` definition.
run: ./pw default
Expand Down
Loading