From 72096a08b69f47c9ca16fd9403c022bf3ade2cf2 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Tue, 19 Sep 2023 16:59:42 -0600 Subject: [PATCH] ci: initial CI implementation includes a raw YAML file which is used to make defining the main YAML more efficient by taking advantage of YAML achors, which are not supported by GitHub's YAML parser. --- .github/_ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 .github/_ci.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/_ci.yml b/.github/_ci.yml new file mode 100644 index 0000000..acfbf7b --- /dev/null +++ b/.github/_ci.yml @@ -0,0 +1,48 @@ +# yq '. | explode(.)' .github/_ci.yml >| .github/workflows/ci.yml +name: CI For CloudFlare Dynamic DNS client + +on: + pull_request: + branches: + - master + push: + branches: + - master + +permissions: + contents: read + +concurrency: + group: std-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + discover: + outputs: + hits: ${{ steps.discovery.outputs.hits }} + runs-on: ubuntu-latest + steps: + - uses: nixbuild/nix-quick-install-action@v25 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + - uses: divnix/std-action/discover@main + id: discovery + + packages: &job + needs: discover + name: ${{ matrix.target.jobName }} + runs-on: ubuntu-latest + if: fromJSON(needs.discover.outputs.hits).packages.build != '' + strategy: + matrix: + target: ${{ fromJSON(needs.discover.outputs.hits).packages.build }} + steps: + - uses: nixbuild/nix-quick-install-action@v25 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + - uses: divnix/std-action/run@main + + shells: + <<: *job + if: fromJSON(needs.discover.outputs.hits).shells.build != '' + strategy: + matrix: + target: ${{ fromJSON(needs.discover.outputs.hits).shells.build }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7d9c33a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +# yq '. | explode(.)' .github/_ci.yml >| .github/workflows/ci.yml +name: CI For CloudFlare Dynamic DNS client +on: + pull_request: + branches: + - master + push: + branches: + - master +permissions: + contents: read +concurrency: + group: std-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + discover: + outputs: + hits: ${{ steps.discovery.outputs.hits }} + runs-on: ubuntu-latest + steps: + - uses: nixbuild/nix-quick-install-action@v25 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + - uses: divnix/std-action/discover@main + id: discovery + packages: + needs: discover + name: ${{ matrix.target.jobName }} + runs-on: ubuntu-latest + if: fromJSON(needs.discover.outputs.hits).packages.build != '' + strategy: + matrix: + target: ${{ fromJSON(needs.discover.outputs.hits).packages.build }} + steps: + - uses: nixbuild/nix-quick-install-action@v25 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + - uses: divnix/std-action/run@main + shells: + needs: discover + name: ${{ matrix.target.jobName }} + runs-on: ubuntu-latest + steps: + - uses: nixbuild/nix-quick-install-action@v25 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + - uses: divnix/std-action/run@main + if: fromJSON(needs.discover.outputs.hits).shells.build != '' + strategy: + matrix: + target: ${{ fromJSON(needs.discover.outputs.hits).shells.build }}