Use Nix in CI #3264
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: 80ch | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled, unlabeled] | |
| jobs: | |
| build: | |
| if: ${{ ! contains( github.event.pull_request.labels.*.name, 'skip 80ch') }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| steps: | |
| - name: Checkout the OxCaml repo | |
| uses: actions/checkout@master | |
| - name: Checkout the parent branch | |
| run: git fetch origin HEAD --deepen 1 | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@v22 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-unstable | |
| - name: Cache Nix store | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.nix-profile | |
| ~/.nix-defexpr | |
| ~/.nix-channels | |
| /nix/store | |
| key: ${{ runner.os }}-nix-${{ matrix.name }}-${{ hashFiles('default.nix') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nix-${{ matrix.name }}- | |
| ${{ runner.os }}-nix- | |
| - name: Check for new >80 character lines | |
| run: nix-shell --run "exec .github/workflows/80ch.sh" |