diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml deleted file mode 100644 index cc577ad..0000000 --- a/.github/workflows/format.yaml +++ /dev/null @@ -1,14 +0,0 @@ -name: Check code formatting - -on: - pull_request: - -jobs: - build: - runs-on: - - ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v22 - - run: nix develop --command fourmolu -m check . diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml deleted file mode 100644 index 036416a..0000000 --- a/.github/workflows/haskell.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Haskell CI - -on: - push: - branches: - - main - tags: - - v* - pull_request: - -jobs: - build: - runs-on: - - ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Setup Haskell - id: setup-haskell - uses: haskell/actions/setup@v1 - with: - ghc-version: '8.10.7' - - - name: Cache - uses: actions/cache@v1 - with: - path: ${{ steps.setup-haskell.outputs.cabal-store }} - key: ${{ runner.os }}-${{ github.sha }} - restore-keys: ${{ runner.os }}- - - - name: Build dependencies - run: cabal build --only-dependencies - - - name: Build - run: cabal build - - - name: Test - run: cabal test - - - name: Copy artifacts - run: | - mkdir ${{ github.workspace }}/build-artifacts - cabal install --install-method=copy --installdir=${{ github.workspace }}/build-artifacts - - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: build-artifact-${{ runner.os }} - path: ${{ github.workspace }}/build-artifacts - if-no-files-found: error - - create-release: - if: startsWith(github.ref, 'refs/tags/') - needs: build - runs-on: ubuntu-latest - - permissions: - contents: write - - steps: - - name: Download build artifact - uses: actions/download-artifact@v3 - - - name: Create release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # Tag artifacts by os (only Linux for now) - mkdir release-artifacts - for path in build-artifact-Linux/*; do - name=${path##*/} - cp $path release-artifacts/$name-Linux - done - - # Strip binaries - strip release-artifacts/* - - gh release create ${{ github.ref_name }} \ - --repo ${{ github.repository }} --draft --generate-notes \ - release-artifacts/* diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index a66fd97..e12c257 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -7,6 +7,27 @@ on: pull_request: jobs: + format: + runs-on: + - ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - uses: DeterminateSystems/magic-nix-cache-action@v2 + + - uses: cachix/cachix-action@v12 + with: + name: foliage + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + + - run: nix develop --accept-flake-config --command fourmolu -m check . + build: runs-on: - ubuntu-latest diff --git a/.github/workflows/update-flake-lock.yml b/.github/workflows/update-flake-lock.yml index d51e30e..08f2905 100644 --- a/.github/workflows/update-flake-lock.yml +++ b/.github/workflows/update-flake-lock.yml @@ -11,11 +11,19 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 + - name: Install Nix - uses: cachix/install-nix-action@v19 + uses: DeterminateSystems/nix-installer-action@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - uses: DeterminateSystems/magic-nix-cache-action@v2 + + - uses: cachix/cachix-action@v12 with: - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + name: foliage + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Update flake.lock uses: DeterminateSystems/update-flake-lock@v16 with: @@ -23,5 +31,6 @@ jobs: pr-labels: | # Labels to be set on the PR dependencies automated + - name: Print PR number run: echo Opened pull request ${{ steps.update.outputs.pull-request-number }}.