Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev-niceties #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on: [push, pull_request]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: lts/*

# Re-use node_modules between runs until package-lock.json changes.
- name: Cache node_modules
id: internal-cache-node_modules
uses: actions/cache@v3
with:
path: node_modules
key: internal-node_modules-ubuntu-latest.x-${{ hashFiles('package-lock.json') }}

# Re-use ~/.elm between runs until elm.json, elm-tooling.json or
# review/elm.json changes. The Elm compiler saves downloaded Elm packages
# to ~/.elm, and elm-tooling saves downloaded tool executables there.
- name: Cache ~/.elm
uses: actions/cache@v3
with:
path: ~/.elm
key: elm-${{ hashFiles('elm.json', 'review/elm.json') }}

- name: Install npm dependencies
if: steps.cache-node_modules.outputs.cache-hit != 'true'

run: npm ci

- name: Run tests
run: npm test

publish:
if: github.ref == 'refs/heads/master' # run only on master
needs: [test] # make sure all your other jobs succeed before trying to publish

# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: lts/*

# Re-use node_modules between runs until package-lock.json changes.
- name: Cache node_modules
id: internal-cache-node_modules
uses: actions/cache@v3
with:
path: node_modules
key: internal-node_modules-ubuntu-latest.x-${{ hashFiles('package-lock.json') }}

# Re-use ~/.elm between runs until elm.json or
# review/elm.json changes. The Elm compiler saves downloaded Elm packages
# to ~/.elm, and elm-tooling saves downloaded tool executables there.
- name: Cache ~/.elm
uses: actions/cache@v3
with:
path: ~/.elm
key: elm-${{ hashFiles('elm.json', 'review/elm.json') }}

- name: Install npm dependencies
if: steps.cache-node_modules.outputs.cache-hit != 'true'
env:
# If you have a `"postinstall": "elm-tooling install"` script in your
# package.json, this turns it into a no-op. We’ll run it in the next
# step because of the caching. If elm-tooling.json changes but
# package-lock.json does not, the postinstall script needs running
# but this step won’t.
NO_ELM_TOOLING_INSTALL: 1
run: npm ci



# Runs a single command using the runners shell
- name: Elm Publish
uses: dillonkearns/elm-publish-action@v1
with:
# Token provided by GitHub
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-elm: ./node_modules/.bin/elm
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions docs.json

Large diffs are not rendered by default.

34 changes: 15 additions & 19 deletions elm.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
{
"type": "package",
"name": "zwilias/elm-rosetree",
"summary": "Strict multiway trees aka rosetrees and a Zipper to go with them",
"license": "BSD-3-Clause",
"version": "1.5.0",
"exposed-modules": [
"Tree",
"Tree.Zipper",
"Tree.Diff"
],
"elm-version": "0.19.0 <= v < 0.20.0",
"dependencies": {
"elm/core": "1.0.0 <= v < 2.0.0"
},
"test-dependencies": {
"elm/html": "1.0.0 <= v < 2.0.0",
"elm-explorations/test": "1.2.1 <= v < 2.0.0"
}
}
"type": "package",
"name": "zwilias/elm-rosetree",
"summary": "Strict multiway trees aka rosetrees and a Zipper to go with them",
"license": "BSD-3-Clause",
"version": "1.5.0",
"exposed-modules": ["Tree", "Tree.Zipper", "Tree.Diff"],
"elm-version": "0.19.0 <= v < 0.20.0",
"dependencies": {
"elm/core": "1.0.0 <= v < 2.0.0"
},
"test-dependencies": {
"elm/html": "1.0.0 <= v < 2.0.0",
"elm-explorations/test": "2.0.0 <= v < 3.0.0"
}
}
Loading