This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
Update upstream to https://github.com/openmeterio/openmeter.git/commi… #199
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
permissions: | |
contents: read | |
env: | |
DAGGER_VERSION: 0.12.0 | |
jobs: | |
build: | |
name: Build | |
runs-on: depot-ubuntu-22.04-16 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
submodules: recursive | |
- name: Set up Nix | |
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Set up magic Nix cache | |
uses: DeterminateSystems/magic-nix-cache-action@b46e247b898aa56e6d2d2e728dc6df6c84fdb738 # v7 | |
- name: Prepare Nix shell | |
run: nix develop --impure .#ci | |
working-directory: upstream | |
- name: Build Server | |
run: nix develop --impure .#ci -c make build-server | |
working-directory: upstream | |
- name: Build Sink Worker | |
run: nix develop --impure .#ci -c make build-sink-worker | |
working-directory: upstream | |
test: | |
name: Test | |
runs-on: depot-ubuntu-22.04-16 | |
steps: | |
# Required as a workaround for Dagger to properly detect Git metadata | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
submodules: recursive | |
- name: Free Disk Space | |
uses: jlumbroso/[email protected] | |
if: github.actor == 'dependabot[bot]' | |
with: | |
# Runs quick, run rm in background | |
tool-cache: true | |
# These run slower as use apt to uninstall packages | |
# Turned on by default, so we disable them | |
android: false | |
dotnet: false | |
haskell: false | |
large-packages: false | |
docker-images: false | |
swap-storage: false | |
- name: Run pipeline | |
uses: dagger/dagger-for-github@29a88e72255e732147ba18a670978b90bcc59efd # v6.4.0 | |
with: | |
verb: call | |
module: github.com/depot/benchmark-openmeter/upstream | |
args: --ref ${{ github.ref }} test | |
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }} | |
version: ${{ env.DAGGER_VERSION }} | |
workdir: upstream | |
- name: Export Dagger Engine logs | |
id: export-dagger-engine-logs | |
run: docker logs $(docker container list --all --filter 'name=^dagger-engine-*' --format '{{.Names}}') > engine.stdout.log 2> engine.stderr.log | |
if: always() | |
continue-on-error: true | |
- name: Upload Dagger Engine logs as artifact | |
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5 | |
if: always() && steps.export-dagger-engine-logs.outcome == 'success' | |
with: | |
name: "[${{ github.job }}] Dagger Engine logs" | |
path: | | |
engine.stdout.log | |
engine.stderr.log | |
retention-days: 14 | |
lint: | |
name: Lint | |
runs-on: depot-ubuntu-22.04-16 | |
steps: | |
# Required as a workaround for Dagger to properly detect Git metadata | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
submodules: recursive | |
- name: Free Disk Space | |
uses: jlumbroso/[email protected] | |
if: github.actor == 'dependabot[bot]' | |
with: | |
# Runs quick, run rm in background | |
tool-cache: true | |
# These run slower as use apt to uninstall packages | |
# Turned on by default, so we disable them | |
android: false | |
dotnet: false | |
haskell: false | |
large-packages: false | |
docker-images: false | |
swap-storage: false | |
- name: Run pipeline | |
uses: dagger/dagger-for-github@29a88e72255e732147ba18a670978b90bcc59efd # v6.4.0 | |
with: | |
verb: call | |
module: github.com/depot/benchmark-openmeter/upstream | |
args: --ref ${{ github.ref }} lint all | |
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }} | |
version: ${{ env.DAGGER_VERSION }} | |
workdir: upstream | |
- name: Export Dagger Engine logs | |
id: export-dagger-engine-logs | |
run: docker logs $(docker container list --all --filter 'name=^dagger-engine-*' --format '{{.Names}}') > engine.stdout.log 2> engine.stderr.log | |
if: always() | |
continue-on-error: true | |
- name: Upload Dagger Engine logs as artifact | |
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5 | |
if: always() && steps.export-dagger-engine-logs.outcome == 'success' | |
with: | |
name: "[${{ github.job }}] Dagger Engine logs" | |
path: | | |
engine.stdout.log | |
engine.stderr.log | |
retention-days: 14 | |
commit-hooks: | |
name: Commit hooks | |
runs-on: depot-ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Set up Nix | |
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Set up magic Nix cache | |
uses: DeterminateSystems/magic-nix-cache-action@b46e247b898aa56e6d2d2e728dc6df6c84fdb738 # v7 | |
- name: Prepare Nix shell | |
run: nix develop --impure .#ci | |
working-directory: upstream | |
- name: Pre-commit hooks | |
run: nix develop --impure .#ci -c pre-commit run -a | |
working-directory: upstream | |
- name: Check commit messages | |
run: nix develop --impure .#ci -c pre-commit run --hook-stage manual | |
working-directory: upstream | |
dev: | |
name: Developer environment | |
runs-on: depot-ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
submodules: recursive | |
- name: Set up Nix | |
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Set up magic Nix cache | |
uses: DeterminateSystems/magic-nix-cache-action@b46e247b898aa56e6d2d2e728dc6df6c84fdb738 # v7 | |
- name: Check | |
run: nix flake check --impure | |
working-directory: upstream | |
- name: Dev shell | |
run: nix develop --impure | |
working-directory: upstream | |
artifacts: | |
name: Artifacts | |
uses: ./.github/workflows/artifacts.yml | |
with: | |
publish: ${{ github.event_name == 'push' }} | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
security-events: write | |
dependency-review: | |
name: Dependency review | |
runs-on: depot-ubuntu-latest | |
if: github.event_name == 'pull_request' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
submodules: recursive | |
- name: Dependency Review | |
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4 | |
quickstart: | |
name: Quickstart | |
runs-on: depot-ubuntu-22.04-16 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
submodules: recursive | |
- name: Launch Docker Compose | |
run: docker compose -f docker-compose.yaml -f docker-compose.ci.yaml up -d | |
working-directory: upstream/quickstart | |
- name: Wait for worker to become ready | |
run: curl --retry 10 --retry-max-time 120 --retry-all-errors http://localhost:10000/healthz | |
- name: Run tests | |
uses: dagger/dagger-for-github@29a88e72255e732147ba18a670978b90bcc59efd # v6.4.0 | |
with: | |
verb: call | |
args: --source .:default quickstart-test --service tcp://localhost:8888 --port 8888 | |
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }} | |
version: ${{ env.DAGGER_VERSION }} | |
workdir: upstream | |
e2e: | |
name: E2E | |
runs-on: depot-ubuntu-22.04-16 | |
steps: | |
# Required as a workaround for Dagger to properly detect Git metadata | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
submodules: recursive | |
- name: Run pipeline | |
uses: dagger/dagger-for-github@29a88e72255e732147ba18a670978b90bcc59efd # v6.4.0 | |
with: | |
verb: call | |
module: github.com/depot/benchmark-openmeter/upstream | |
args: --ref ${{ github.ref }} etoe | |
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }} | |
version: ${{ env.DAGGER_VERSION }} | |
workdir: ./upstream | |
- name: Export Dagger Engine logs | |
id: export-dagger-engine-logs | |
run: docker logs $(docker container list --all --filter 'name=^dagger-engine-*' --format '{{.Names}}') > engine.stdout.log 2> engine.stderr.log | |
if: always() | |
continue-on-error: true | |
- name: Upload Dagger Engine logs as artifact | |
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5 | |
if: always() && steps.export-dagger-engine-logs.outcome == 'success' | |
with: | |
name: "[${{ github.job }}] Dagger Engine logs" | |
path: | | |
engine.stdout.log | |
engine.stderr.log | |
retention-days: 14 | |
dagger: | |
name: CI | |
runs-on: depot-ubuntu-22.04-16 | |
steps: | |
# Required as a workaround for Dagger to properly detect Git metadata | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Free Disk Space | |
uses: jlumbroso/[email protected] | |
if: github.actor == 'dependabot[bot]' | |
with: | |
# Runs quick, run rm in background | |
tool-cache: true | |
# These run slower as use apt to uninstall packages | |
# Turned on by default, so we disable them | |
android: false | |
dotnet: false | |
haskell: false | |
large-packages: false | |
docker-images: false | |
swap-storage: false | |
- name: Run pipeline | |
uses: dagger/dagger-for-github@29a88e72255e732147ba18a670978b90bcc59efd # v6.4.0 | |
timeout-minutes: 40 | |
with: | |
verb: call | |
module: github.com/depot/benchmark-openmeter/upstream | |
args: --ref ${{ github.ref }} ci | |
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }} | |
version: ${{ env.DAGGER_VERSION }} | |
- name: Export Dagger Engine logs | |
id: export-dagger-engine-logs | |
run: docker logs $(docker container list --all --filter 'name=^dagger-engine-*' --format '{{.Names}}') > engine.stdout.log 2> engine.stderr.log | |
if: always() | |
continue-on-error: true | |
- name: Upload Dagger Engine logs as artifact | |
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5 | |
if: always() && steps.export-dagger-engine-logs.outcome == 'success' | |
with: | |
name: "[${{ github.job }}] Dagger Engine logs" | |
path: | | |
engine.stdout.log | |
engine.stderr.log | |
retention-days: 14 |