Skip to content

Commit 402c4fa

Browse files
committed
Merge commit '8fc913d39a2a63f4e7e29a3a09b0bfcd78892945' into code-cov
2 parents 29bce4a + 8fc913d commit 402c4fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+4699
-274
lines changed

.github/workflows/_container.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
on:
2+
workflow_call:
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v4
10+
with:
11+
persist-credentials: false
12+
13+
- name: Generate Metadata
14+
id: meta
15+
uses: docker/metadata-action@v5
16+
with:
17+
images: ghcr.io/${{ github.repository }}
18+
tags: |
19+
type=raw,value=latest
20+
type=semver,pattern={{version}}
21+
type=semver,pattern={{major}}.{{minor}}
22+
type=semver,pattern={{major}}
23+
24+
- name: Build and export to Docker local cache
25+
uses: docker/build-push-action@v6
26+
env:
27+
DOCKER_BUILD_RECORD_UPLOAD: false
28+
with:
29+
# Need load and tags so we can test it below
30+
load: true
31+
tags: test_tag
32+
33+
- name: Test cli works in cached runtime image
34+
run: docker run --rm test_tag --version
35+
36+
- name: Log in to GHCR
37+
uses: docker/login-action@v3
38+
with:
39+
registry: ghcr.io/${{ github.repository_owner }}
40+
username: ${{ github.actor }}
41+
password: ${{ secrets.GITHUB_TOKEN }}
42+
43+
# This does not build the image again, it will find the image in the
44+
# Docker cache and publish it
45+
- name: Push cached image to container registry
46+
uses: docker/build-push-action@v6
47+
env:
48+
DOCKER_BUILD_RECORD_UPLOAD: false
49+
with:
50+
push: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
51+
tags: ${{ steps.meta.outputs.tags }}
52+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/_helm.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Package helm charts
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
package-helm-charts:
8+
name: Package and Push Helm Chart
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
persist-credentials: false
16+
17+
- name: Generate Metadata
18+
id: meta
19+
uses: docker/metadata-action@v5
20+
with:
21+
tags: |
22+
type=semver,pattern={{version}}
23+
24+
- name: Install helm
25+
uses: Azure/setup-helm@v4
26+
27+
- name: Login to chart registry
28+
run: |
29+
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${{ github.repository_owner }} --password-stdin
30+
31+
- name: Package chart
32+
run: |
33+
helm dependencies update Charts/glazed
34+
helm package Charts/glazed --version "${{ steps.meta.outputs.version }}" --app-version "${{ steps.meta.outputs.version }}" -d /tmp/
35+
36+
- name: Publish chart
37+
env:
38+
REPO: ${{ github.repository_owner }}
39+
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
40+
# Helm push requires the registry name is all lowercase
41+
run: |
42+
helm push /tmp/glazed-*.tgz oci://ghcr.io/${REPO@L}/charts

.github/workflows/_rust.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
on:
2+
workflow_call:
3+
4+
env:
5+
CARGO_TERM_COLOR: always
6+
7+
jobs:
8+
format:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
persist-credentials: false
14+
- uses: dtolnay/rust-toolchain@stable
15+
with:
16+
toolchain: nightly
17+
components: rustfmt
18+
- name: Check formatting
19+
# Use nightly for formatting to enable unstable formatting styles
20+
# * group imports
21+
# * import_granularity
22+
run: cargo +nightly fmt -- --check
23+
24+
lint:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
persist-credentials: false
30+
- uses: dtolnay/rust-toolchain@stable
31+
with:
32+
toolchain: stable
33+
components: clippy
34+
- uses: Swatinem/rust-cache@v2
35+
- name: Clippy
36+
run: |
37+
cargo --version
38+
cargo clippy --version
39+
cargo clippy --all-targets --all-features -- --deny warnings
40+
41+
test:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
with:
46+
persist-credentials: false
47+
- uses: dtolnay/rust-toolchain@stable
48+
with:
49+
toolchain: stable
50+
- uses: Swatinem/rust-cache@v2
51+
- name: Install cargo-llvm-cov
52+
uses: taiki-e/install-action@cargo-llvm-cov
53+
- name: Run tests and generate code coverage
54+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
55+
- name: Upload coverage to Codecov
56+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5
57+
with:
58+
files: lcov.info
59+
fail_ci_if_error: true
60+
env:
61+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
62+
# Ensure that no files (most likely the Cargo.lock file) have changed
63+
- name: Unstaged Changes
64+
run: git diff --exit-code

.github/workflows/ci.yml

Lines changed: 13 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -4,64 +4,20 @@ on:
44
push:
55
branches:
66
- main
7+
tags:
8+
- "*"
9+
710
pull_request:
811

9-
env:
10-
CARGO_TERM_COLOR: always
1112

1213
jobs:
13-
format:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v4
17-
- uses: dtolnay/rust-toolchain@stable
18-
with:
19-
toolchain: nightly
20-
components: rustfmt
21-
- name: Check formatting
22-
# Use nightly for formatting to enable unstable formatting styles
23-
# * group imports
24-
# * import_granularity
25-
run: cargo +nightly fmt -- --check
26-
27-
lint:
28-
runs-on: ubuntu-latest
29-
steps:
30-
- uses: actions/checkout@v4
31-
- uses: dtolnay/rust-toolchain@stable
32-
with:
33-
toolchain: stable
34-
components: clippy
35-
- uses: Swatinem/rust-cache@v2
36-
- name: Clippy
37-
run: |
38-
cargo --version
39-
cargo clippy --version
40-
cargo clippy --all-targets --all-features -- --deny warnings
41-
42-
test:
43-
runs-on: ubuntu-latest
44-
steps:
45-
- uses: actions/checkout@v4
46-
- uses: dtolnay/rust-toolchain@stable
47-
with:
48-
toolchain: stable
49-
- uses: Swatinem/rust-cache@v2
50-
51-
- name: Install cargo-llvm-cov
52-
uses: taiki-e/install-action@cargo-llvm-cov
53-
54-
- name: Run tests and generate code coverage
55-
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
56-
57-
- name: Upload coverage to Codecov
58-
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5
59-
with:
60-
files: lcov.info
61-
fail_ci_if_error: true
62-
env:
63-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
64-
65-
# Ensure that no files (most likely the Cargo.lock file) have changed
66-
- name: Unstaged Changes
67-
run: git diff --exit-code
14+
rust:
15+
uses: ./.github/workflows/_rust.yml
16+
17+
container:
18+
needs: rust
19+
uses: ./.github/workflows/_container.yml
20+
21+
helm:
22+
needs: container
23+
uses: ./.github/workflows/_helm.yml

0 commit comments

Comments
 (0)