From 525a229dac0229dffa809e7b11d8c39b22761cc5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 3 Jan 2021 18:47:05 +0100 Subject: [PATCH] Convert validate-openapi to a Hydra job --- .github/workflows/test.yml | 10 +--------- flake.nix | 8 ++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37281924..7d98e3ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,12 +11,4 @@ jobs: fetch-depth: 0 - uses: cachix/install-nix-action@v12 #- run: nix flake check - - run: nix-build -A checks.x86_64-linux.build - #validate-openapi: - # runs-on: ubuntu-18.04 - # steps: - # - uses: actions/checkout@v2 - # with: - # fetch-depth: 0 - # - uses: cachix/install-nix-action@v12 - # - run: nix-shell -p openapi-generator-cli --run "openapi-generator-cli validate -i ./hydra-api.yaml" + - run: nix-build -A checks.x86_64-linux.build -A checks.x86_64-linux.validate-openapi diff --git a/flake.nix b/flake.nix index 0726140c..de4f29c5 100644 --- a/flake.nix +++ b/flake.nix @@ -482,11 +482,19 @@ ''; }; + tests.validate-openapi = pkgs.runCommand "validate-openapi" + { buildInputs = [ pkgs.openapi-generator-cli ]; } + '' + openapi-generator-cli validate -i ${./hydra-api.yaml} + touch $out + ''; + container = nixosConfigurations.container.config.system.build.toplevel; }; checks.x86_64-linux.build = hydraJobs.build.x86_64-linux; checks.x86_64-linux.install = hydraJobs.tests.install.x86_64-linux; + checks.x86_64-linux.validate-openapi = hydraJobs.tests.validate-openapi; packages.x86_64-linux.hydra = pkgs.hydra; defaultPackage.x86_64-linux = pkgs.hydra;