feat(eventlog-live-otelcol): pack configuration file JSON Schema #429
This file contains hidden or 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: | |
| - "master" | |
| pull_request: | |
| # Set the default shell on all platforms. | |
| defaults: | |
| run: | |
| shell: sh | |
| concurrency: | |
| group: "${{ github.workflow }}-${{ github.ref }}" | |
| cancel-in-progress: true | |
| jobs: | |
| ############################################################################# | |
| # Build | |
| ############################################################################# | |
| build: | |
| name: | | |
| ${{ format( | |
| 'Build on {0}{1}{2}', | |
| startsWith(matrix.os, 'ubuntu-') && 'Linux' || startsWith(matrix.os, 'macOS-') && 'macOS', | |
| matrix.ghc-version && format(' with GHC {0}', matrix.ghc-version), | |
| matrix.cabal-flags && format(' with {0}', matrix.cabal-flags) | |
| ) | |
| }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| # The dev-dependencies file lists the versions of all system dependencies | |
| # required for development. It is formatted in such a way that it is easy | |
| # to use from GitHub Actions. This step outputs the versions to make them | |
| # available to all following steps under "steps.dev-dependencies.outputs" | |
| - name: ποΈ Read dev-dependencies | |
| run: cat "./scripts/dev-dependencies.txt" >> "$GITHUB_OUTPUT" | |
| id: dev-dependencies | |
| - name: π οΈ Setup Haskell | |
| id: setup-haskell | |
| uses: haskell-actions/setup@v2 | |
| with: | |
| ghc-version: ${{ matrix.ghc-version }} | |
| - name: π οΈ Setup Protobuf Compiler | |
| uses: ./.github/actions/setup-protoc | |
| with: | |
| protoc-version: ${{ steps.dev-dependencies.outputs.protoc }} | |
| - name: ποΈ Generate Cabal plan | |
| run: cabal build all ${{ matrix.cabal-flags }} --dry-run | |
| - name: πΎ Restore Cabal dependencies | |
| uses: actions/cache/restore@v4 | |
| id: cache-cabal | |
| env: | |
| key: build-${{ runner.os }}-ghc-${{ steps.setup-haskell.outputs.ghc-version }}-cabal-${{ steps.setup-haskell.outputs.cabal-version }}-flags-${{ matrix.cabal-flags }} | |
| with: | |
| path: ${{ steps.setup-haskell.outputs.cabal-store }} | |
| key: ${{ env.key }}-plan-${{ hashFiles('dist-newstyle/cache/plan.json') }} | |
| restore-keys: ${{ env.key }}- | |
| - name: π οΈ Build Cabal dependencies | |
| run: cabal build all ${{ matrix.cabal-flags }} --only-dependencies | |
| - name: πΎ Save Cabal dependencies | |
| uses: actions/cache/save@v4 | |
| if: ${{ steps.cache-cabal.outputs.cache-hit != 'true' }} | |
| with: | |
| path: ${{ steps.setup-haskell.outputs.cabal-store }} | |
| key: ${{ steps.cache-cabal.outputs.cache-primary-key }} | |
| - name: ποΈ Build | |
| run: cabal build all ${{ matrix.cabal-flags }} | |
| - name: π§ͺ Test fibber-dumper | |
| run: ./examples/fibber/fibber-dumper.sh | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - "ubuntu-latest" | |
| - "macOS-latest" | |
| ghc-version: | |
| - "9.8.4" | |
| - "9.10.2" | |
| - "9.12.2" | |
| include: | |
| - cabal-flags: "" | |
| - os: "ubuntu-latest" | |
| ghc-version: "9.4.8" | |
| - os: "ubuntu-latest" | |
| ghc-version: "9.6.7" | |
| - os: "ubuntu-latest" | |
| ghc-version: "9.10.2" | |
| cabal-flags: "-f+use-ghc-debug-stub" | |
| - os: "ubuntu-latest" | |
| ghc-version: "9.10.2" | |
| cabal-flags: "-f+use-template-haskell-lift" | |
| ############################################################################# | |
| # Build dockerfiles | |
| ############################################################################# | |
| build-dockerfiles: | |
| name: "Build dockerfiles" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: π οΈ Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: ποΈ Build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| file: dockerfiles/Dockerfile.${{ matrix.dockerfile }} | |
| push: false | |
| tags: | | |
| well-typed/${{ | |
| startsWith(matrix.dockerfile, 'eventlog-live-') | |
| && matrix.dockerfile | |
| || format('eventlog-live-examples-{0}', matrix.dockerfile) | |
| }}:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dockerfile: | |
| - "collatzer" | |
| - "dumper" | |
| - "eventlog-live-influxdb" | |
| - "eventlog-live-otelcol" | |
| - "fibber" | |
| - "ghc-events-show" | |
| - "oddball" | |
| ############################################################################# | |
| # Build Nix VM | |
| ############################################################################# | |
| build-nix-vm: | |
| name: "Build Nix VM" | |
| runs-on: "ubuntu-latest" | |
| if: github.ref_name == 'master' && github.event_name == 'push' | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: π οΈ Free Disk Space | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| tool-cache: true | |
| - name: π οΈ Install Nix | |
| uses: cachix/install-nix-action@v31 | |
| with: | |
| nix_path: nixpkgs=channel:nixpkgs-unstable | |
| - name: ποΈ Build | |
| run: nix build .#standalone-vm | |
| working-directory: "nix/${{ matrix.nix-vm-directory }}" | |
| - name: π¦ Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "${{ matrix.nix-vm-directory }}.qcow2" | |
| path: "${{ github.workspace }}/nix/${{ matrix.nix-vm-directory }}/result/nixos.qcow2" | |
| if-no-files-found: error | |
| compression-level: 9 | |
| overwrite: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| nix-vm-directory: | |
| - "eventlog-live-otelcol" | |
| ############################################################################# | |
| # Test with cabal-docspec | |
| ############################################################################# | |
| test-cabal-docspec: | |
| name: "Test with cabal-docspec" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: ποΈ Read dev-dependencies | |
| run: cat "./scripts/dev-dependencies.txt" >> "$GITHUB_OUTPUT" | |
| id: dev-dependencies | |
| - name: π οΈ Setup cabal-docspec | |
| uses: ./.github/actions/setup-cabal-docspec | |
| - name: π οΈ Update package list for Hackage | |
| run: | | |
| mkdir ~/.cabal | |
| cabal user-config update | |
| cabal update | |
| - name: π§ͺ Test with cabal-docspec | |
| run: ./scripts/test-cabal-docspec.sh | |
| ############################################################################# | |
| # Lint with actionlint | |
| ############################################################################# | |
| lint-actionlint: | |
| name: "Lint with actionlint" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: ποΈ Read dev-dependencies | |
| run: cat "./scripts/dev-dependencies.txt" >> "$GITHUB_OUTPUT" | |
| id: dev-dependencies | |
| - name: "Setup actionlint" | |
| uses: ./.github/actions/setup-actionlint | |
| with: | |
| actionlint-version: ${{ steps.dev-dependencies.outputs.actionlint }} | |
| - name: ποΈ Lint with actionlint | |
| run: ./scripts/lint-actionlint.sh | |
| ############################################################################# | |
| # Lint with cabal | |
| ############################################################################# | |
| lint-cabal: | |
| name: "Lint with Cabal" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: ποΈ Read dev-dependencies | |
| run: cat "./scripts/dev-dependencies.txt" >> "$GITHUB_OUTPUT" | |
| id: dev-dependencies | |
| - name: π οΈ Install Haskell | |
| uses: haskell-actions/setup@v2 | |
| with: | |
| ghc-version: ${{ steps.dev-dependencies.outputs.ghc }} | |
| cabal-version: ${{ steps.dev-dependencies.outputs.cabal }} | |
| id: setup-haskell | |
| - name: ποΈ Lint with Cabal | |
| run: ./scripts/lint-cabal.sh | |
| ############################################################################# | |
| # Lint with cabal-fmt | |
| ############################################################################# | |
| lint-cabal-fmt: | |
| name: "Lint with cabal-fmt" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: ποΈ Read dev-dependencies | |
| run: cat "./scripts/dev-dependencies.txt" >> "$GITHUB_OUTPUT" | |
| id: dev-dependencies | |
| - name: π οΈ Install cabal-fmt | |
| uses: ./.github/actions/setup-cabal-fmt | |
| with: | |
| cabal-fmt-version: ${{ steps.dev-dependencies.outputs.cabal-fmt }} | |
| ghc-version: ${{ steps.dev-dependencies.outputs.ghc }} | |
| cabal-version: ${{ steps.dev-dependencies.outputs.cabal }} | |
| - name: ποΈ Lint with cabal-fmt | |
| run: ./scripts/lint-cabal-fmt.sh | |
| ############################################################################# | |
| # Lint with HLint | |
| ############################################################################# | |
| lint-hlint: | |
| name: "Lint with HLint" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: ποΈ Read dev-dependencies | |
| run: cat "./scripts/dev-dependencies.txt" >> "$GITHUB_OUTPUT" | |
| id: dev-dependencies | |
| - name: π οΈ Install HLint | |
| uses: haskell-actions/hlint-setup@v2 | |
| with: | |
| version: ${{ steps.dev-dependencies.outputs.hlint }} | |
| id: setup-hlint | |
| - name: ποΈ Lint with HLint | |
| run: ./scripts/lint-hlint.sh | |
| env: | |
| HLINT: ${{ steps.setup-hlint.outputs.hlint-bin }} | |
| ############################################################################# | |
| # Lint with Fourmolu | |
| ############################################################################# | |
| lint-fourmolu: | |
| name: "Lint with Fourmolu" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: ποΈ Read dev-dependencies | |
| run: cat "./scripts/dev-dependencies.txt" >> "$GITHUB_OUTPUT" | |
| id: dev-dependencies | |
| - name: π οΈ Install Fourmolu | |
| uses: ./.github/actions/setup-fourmolu | |
| with: | |
| fourmolu-version: ${{ steps.dev-dependencies.outputs.fourmolu }} | |
| ghc-version: ${{ steps.dev-dependencies.outputs.ghc }} | |
| cabal-version: ${{ steps.dev-dependencies.outputs.cabal }} | |
| - name: ποΈ Lint with Fourmolu | |
| run: ./scripts/lint-fourmolu.sh | |
| ############################################################################# | |
| # Lint with Nixfmt | |
| ############################################################################# | |
| lint-nixfmt: | |
| name: "Lint with Nixfmt" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: ποΈ Read dev-dependencies | |
| run: cat "./scripts/dev-dependencies.txt" >> "$GITHUB_OUTPUT" | |
| id: dev-dependencies | |
| - name: π οΈ Install Nix | |
| uses: cachix/install-nix-action@v31 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-25.05 | |
| - name: ποΈ Lint with Nixfmt | |
| run: nix-shell -p nixfmt-rfc-style --run 'sh ./scripts/lint-nixfmt.sh' | |
| ############################################################################# | |
| # Lint with Prettier | |
| ############################################################################# | |
| lint-prettier: | |
| name: "Lint with Prettier" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: ποΈ Read dev-dependencies | |
| run: cat "./scripts/dev-dependencies.txt" >> "$GITHUB_OUTPUT" | |
| id: dev-dependencies | |
| - name: ποΈ Lint with Prettier | |
| run: ./scripts/lint-prettier.sh | |
| env: | |
| PRETTIER: "npm exec --yes --package=prettier@${{ steps.dev-dependencies.outputs.prettier }} prettier --" | |
| ############################################################################# | |
| # Lint with ShellCheck | |
| ############################################################################# | |
| lint-shellcheck: | |
| name: "Lint with ShellCheck" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: ποΈ Read dev-dependencies | |
| run: cat "./scripts/dev-dependencies.txt" >> "$GITHUB_OUTPUT" | |
| id: dev-dependencies | |
| - name: π οΈ Install ShellCheck | |
| uses: ./.github/actions/setup-shellcheck | |
| with: | |
| shellcheck-version: ${{ steps.dev-dependencies.outputs.shellcheck }} | |
| - name: ποΈ Lint with ShellCheck | |
| run: ./scripts/lint-shellcheck.sh | |
| ############################################################################# | |
| # Lint with cabal2nix | |
| ############################################################################# | |
| lint-cabal2nix: | |
| name: "Lint with cabal2nix" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: π οΈ Install Nix | |
| uses: cachix/install-nix-action@v31 | |
| with: | |
| nix_path: nixpkgs=channel:nixpkgs-unstable | |
| - name: ποΈ Lint with cabal2nix | |
| run: | | |
| nix-shell -p haskellPackages.cabal2nix --run '\ | |
| cabal2nix file://${{ github.workspace }}/eventlog-live && \ | |
| cabal2nix file://${{ github.workspace }}/eventlog-live-influxdb && \ | |
| cabal2nix file://${{ github.workspace }}/eventlog-live-otelcol' | |
| shell: bash |