diff --git a/.github/workflows/devtools_test.yml b/.github/workflows/devtools_test.yml new file mode 100644 index 0000000000..6a31e0bd95 --- /dev/null +++ b/.github/workflows/devtools_test.yml @@ -0,0 +1,41 @@ +on: + pull_request: + +name: Test the devtools nix files + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + devtools-test: + name: devtools-test + runs-on: [ubuntu-20.04] + timeout-minutes: 120 + steps: + - uses: actions/checkout@v3 + # TODO only run if flake.lock changed + + - name: test devtools/flake.nix + id: devtools_test_step + run: | + echo "ROC_FOLDER=$(realpath .)" >> $GITHUB_ENV + mkdir -p ../temp + cp devtools/flake.nix ../temp + cp devtools/flake.lock ../temp + cd ../temp + git init + git add flake.nix flake.lock + sed -i 's|/home/username/gitrepos/roc|${{ env.ROC_FOLDER }}|g' flake.nix + nix develop + + - name: Print tip on fail + if: steps.devtools_test_step.outcome == 'failure' + run: | + echo "The devtools test failed, this can likely be fixed by" + echo "locally deleting devtools/flake.lock and following the" + echo "instructions in devtools/README.md. This will create a" + echo "new flake.lock you should use to replace the old devtools/flake.lock" + + + \ No newline at end of file diff --git a/devtools/README.md b/devtools/README.md index 2825119d97..c8c0f93383 100755 --- a/devtools/README.md +++ b/devtools/README.md @@ -7,9 +7,9 @@ The flake in this folder is meant for vscode, feel free to create a PR if you'li Further steps: -1. Copy the flake.nix and flake.lock file to a new folder outside of the roc repo folder. +1. Copy the flake.nix and flake.lock file from the devtools folder to a new folder outside of the roc repo folder. 1. Run `git init` in the new folder. -1. Execute `git add flake.nix`, nix will error if you don't do this. +1. Execute `git add flake.nix flake.lock`, nix will error if you don't do this. 1. Change `roc.url = "path:/home/anton/gitrepos/roc";` to the location of the roc folder on your machine. 1. Follow instructions about vscode extensions [here](#extensions). 1. add other dev tools you like in the `devInputs` list. You can search for those [here](https://search.nixos.org/packages).