Skip to content

Commit

Permalink
update action step names, lint YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed May 13, 2021
1 parent ba2893b commit ca2b323
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 61 deletions.
98 changes: 44 additions & 54 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,50 @@
name: "Check DVC GitHub Action"

name: Check DVC GitHub Action
on: [push]

jobs:
check:
strategy:
matrix:
runs-on: [ '{"runs-on": "ubuntu-latest"}',
'{"runs-on": "macos-latest"}',
'{"runs-on": "ubuntu-latest", "container": "ubuntu:18.04"}',
'{"runs-on": "windows-latest"}']

runs-on: ${{ fromJSON(matrix.runs-on).runs-on }}
container: ${{ fromJSON(matrix.runs-on).container }}

os:
[
'{"runs-on": "ubuntu-latest"}',
'{"runs-on": "macos-latest"}',
'{"runs-on": "ubuntu-latest", "container": "ubuntu:18.04"}',
'{"runs-on": "windows-latest"}',
]
runs-on: ${{ fromJSON(matrix.os).runs-on }}
container: ${{ fromJSON(matrix.os).container }}
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
if: "fromJSON(matrix.runs-on).container == 'ubuntu:18.04'"
with:
node-version: '12'

- uses: actions/setup-python@v2
if: "contains(fromJSON(matrix.runs-on).runs-on, 'windows')"
with:
python-version: '3.x'

- name: "npm ci"
run: npm ci

- name: "lint"
run: npm run lint

- name: "tests"
run: |
npm run test
- uses: iterative/setup-dvc@v1
with:
version: '1.0.1'

- name: "DVC test"
if: "!contains(fromJSON(matrix.runs-on).runs-on, 'windows')"
run: |
DVC_VER=$(dvc --version)
if [ $DVC_VER != '1.0.1' ]; then
exit 1
fi
- uses: iterative/setup-dvc@v1
with:
version: latest

- name: "DVC test"
if: "!contains(fromJSON(matrix.runs-on).runs-on, 'windows')"
run: |
DVC_VER=$(dvc --version)
if [ $DVC_VER == '1.0.1' ]; then
exit 1
fi
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
if: "fromJSON(matrix.os).container == 'ubuntu:18.04'"
with:
node-version: '12'
- uses: actions/setup-python@v2
if: "contains(fromJSON(matrix.os).runs-on, 'windows')"
with:
python-version: '3.x'
- run: npm ci
- run: npm run lint
- run: npm run test
- name: run local action with '1.0.1'
uses: ./.github/..
with:
version: '1.0.1'
- name: test DVC version
if: "!contains(fromJSON(matrix.os).runs-on, 'windows')"
run: |
DVC_VER=$(dvc --version)
if [ $DVC_VER != '1.0.1' ]; then
exit 1
fi
- name: run local action with 'latest'
uses: ./.github/..
with:
version: latest
- name: test DVC version
if: "!contains(fromJSON(matrix.os).runs-on, 'windows')"
run: |
DVC_VER=$(dvc --version)
if [ $DVC_VER == '1.0.1' ]; then
exit 1
fi
15 changes: 9 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
name: 'Setup DVC (Data Version Control)'
description: 'Sets up DVC (Data Version Control) in your GitHub Actions workflow.'
description:
'Sets up DVC (Data Version Control) in your GitHub Actions workflow.'
author: 'Iterative, Inc.'
inputs:
version:
description: 'The version of DVC to install. A value of `latest` will install the latest version of DVC. Defaults to `latest`.'
default: 'latest'
description:
'The version of DVC to install. A value of `latest` will install the
latest version of DVC. Defaults to `latest`.'
default: latest
required: false
runs:
using: 'node12'
using: node12
main: 'dist/index.js'
branding:
icon: 'terminal'
color: 'purple'
icon: terminal
color: purple
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"*.js": [
"eslint --fix"
],
"*.md": [
"*.{md,yaml,yml}": [
"prettier --write"
]
},
Expand Down

0 comments on commit ca2b323

Please sign in to comment.