-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (62 loc) · 2.27 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: transform-xml-to-json
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
include:
- os: ubuntu-latest
PLATFORM: Linux-x86_64
# - os: ubuntu-latest
# PLATFORM: Linux-x86_64
# 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@v2
- name: Setup node and its dependencies
shell: bash -l {0}
run: |
export NVM_VERSION=0.39.0
export NODE_VERSION=18.17.0
export NPM_VERSION=8.5.5
export NVM_DIR="$HOME/.nvm"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v$NVM_VERSION/install.sh | bash
echo "Setting up the variables to run nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
echo "Installing the correct node version"
nvm install $NODE_VERSION
echo "Check the version of npm"
CURR_NPM_VERSION=`npm --version`
if [ $CURR_NPM_VERSION != $NPM_VERSION ];
then
echo "Invalid npm version, expected $NPM_VERSION, got $CURR_NPM_VERSION"
npm install npm@$NPM_VERSION
fi
npm install -g [email protected]
npm install enketo-transformer
npm install libxslt
- name: Run the transformer script
shell: bash -l {0}
run: |
node .
pwd
ls -lha
- name: Commit
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git add data-json
git commit --no-verify -m 'Update data-json' || echo "No changes to commit"
git push || echo "No changes to commit"