Skip to content

Commit

Permalink
setup
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn committed Oct 19, 2023
1 parent d29bb3e commit 5fe6593
Showing 1 changed file with 50 additions and 42 deletions.
92 changes: 50 additions & 42 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
- uses: actions/checkout@v3
- id: bazel_6
run: echo "bazelversion=$(head -n 1 .bazelversion)" >> $GITHUB_OUTPUT
- id: bazel_5
run: echo "bazelversion=5.3.2" >> $GITHUB_OUTPUT
# - id: bazel_5
# run: echo "bazelversion=5.3.2" >> $GITHUB_OUTPUT
outputs:
# Will look like ["<version from .bazelversion>", "5.3.2"]
bazelversions: ${{ toJSON(steps.*.outputs.bazelversion) }}
Expand Down Expand Up @@ -60,12 +60,12 @@ jobs:
bazelversion: ${{ fromJSON(needs.matrix-prep-bazelversion.outputs.bazelversions) }}
folder:
- .
- e2e/custom_registry
- e2e/wasm
- e2e/smoke
- e2e/crane_as_registry
# - e2e/custom_registry
# - e2e/wasm
# - e2e/smoke
# - e2e/crane_as_registry

bzlmodEnabled: [true, false]
bzlmodEnabled: [false] # [true, false]
exclude:
# Don't test bzlmod with Bazel 5 (not supported)
- bazelversion: 5.3.2
Expand All @@ -80,17 +80,17 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Mount bazel caches
uses: actions/cache@v3
with:
path: |
~/.cache/bazel
~/.cache/bazel-repo
key: bazel-cache-${{ matrix.os }}-${{ matrix.folder }}-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE') }}
restore-keys: |
bazel-cache-${{ matrix.os }}-${{ matrix.folder }}
bazel-cache-${{ matrix.os }}
bazel-cache-
# - name: Mount bazel caches
# uses: actions/cache@v3
# with:
# path: |
# ~/.cache/bazel
# ~/.cache/bazel-repo
# key: bazel-cache-${{ matrix.os }}-${{ matrix.folder }}-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE') }}
# restore-keys: |
# bazel-cache-${{ matrix.os }}-${{ matrix.folder }}
# bazel-cache-${{ matrix.os }}
# bazel-cache-

- name: Set bzlmod flag
# Store the --enable_bzlmod flag that we add to the test command below
Expand All @@ -103,36 +103,44 @@ jobs:
working-directory: ${{ matrix.folder }}
run: echo "${{ matrix.bazelversion }}" > .bazelversion

- name: Configure TestContainers cloud
if: ${{ matrix.os == 'macos-latest' }}
uses: atomicjar/testcontainers-cloud-setup-action@main

- name: Setup upterm session
uses: lhotari/action-upterm@v1

- name: bazel test //...
working-directory: ${{ matrix.folder }}
if: ${{ false }}
env:
# Bazelisk will download bazel to here, ensure it is cached between runs.
XDG_CACHE_HOME: ~/.cache/bazel-repo
run: bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc --bazelrc=.bazelrc test ${{ steps.set_bzlmod_flag.outputs.bzlmod_flag }} //...
test-auth:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup bats
uses: mig4/setup-bats@v1
with:
bats-version: "1.8.2"
# test-auth:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Setup bats
# uses: mig4/setup-bats@v1
# with:
# bats-version: "1.8.2"

- name: Setup bats helpers
uses: brokenpip3/[email protected]
with:
support-path: /usr/lib/bats/bats-support
support-version: "0.3.0"
assert-path: /usr/lib/bats/bats-assert
assert-version: "2.1.0"
# - name: Setup bats helpers
# uses: brokenpip3/[email protected]
# with:
# support-path: /usr/lib/bats/bats-support
# support-version: "0.3.0"
# assert-path: /usr/lib/bats/bats-assert
# assert-version: "2.1.0"

- name: bats -r .
working-directory: e2e/auth
run: |
for i in {1..5}; do bats -r . && break || sleep 5; done
# - name: bats -r .
# working-directory: e2e/auth
# run: |
# for i in {1..5}; do bats -r . && break || sleep 5; done

- name: bats -r . --enable_bzlmod
working-directory: e2e/auth
run: |
echo "build --enable_bzlmod" >> .bazelrc.user
for i in {1..5}; do bats -r . && break || sleep 5; done
# - name: bats -r . --enable_bzlmod
# working-directory: e2e/auth
# run: |
# echo "build --enable_bzlmod" >> .bazelrc.user
# for i in {1..5}; do bats -r . && break || sleep 5; done

0 comments on commit 5fe6593

Please sign in to comment.