Skip to content

Commit

Permalink
chore(ci): Add github actions (#8)
Browse files Browse the repository at this point in the history
* chore(ci): Add github actions

* chore(ci): CI changes

* chore(ci): Github actions

* chore(ci): Github actions

* chore(ci): Github actions

* chore(ci): Github actions
  • Loading branch information
larowlan authored Jul 1, 2021
1 parent 7359f6a commit f4c82ec
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 31 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: validate
on:
push:
branches:
- 'master'
- 'beta'
pull_request: {}
jobs:
main:
strategy:
matrix:
node: [12, 14]
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: 🧹 Linting
run: npm run lint

- name: ✅ Tests
run: npm run test

release:
needs: main
runs-on: ubuntu-latest
if:
${{ github.repository == 'larowlan/twig-testing-library' &&
contains('refs/heads/master',github.ref) && github.event_name == 'push' }}
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup node
uses: actions/setup-node@v2
with:
node-version: 14

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: 🏗 Run build script
run: npm run build

- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 17
branches: |
[
'master'
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ const loadTemplate = async (file, context = {}, namespaces) => {

Twig.cache(false)
Twig.extendFunction("create_attribute", (value) => {
if (typeof value === 'object' && value !== null) {
if (typeof value === "object" && value !== null) {
value = Object.entries(value)
}
return new DrupalAttribute(value);
return new DrupalAttribute(value)
})
Twig.twigAsync = (options) => {
return new Promise((resolve, reject) => {
Expand Down

0 comments on commit f4c82ec

Please sign in to comment.