Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
qetza committed Mar 4, 2024
0 parents commit 25639ca
Show file tree
Hide file tree
Showing 25 changed files with 55,507 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: ["https://www.paypal.com/donate/?hosted_button_id=CCEAVYA8DUFD8"]
51 changes: 51 additions & 0 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Check dist

on:
pull_request:
branches:
- main
- releases/*
paths-ignore:
- '**.md'
push:
branches:
- main
- releases/*
paths-ignore:
- '**.md'
workflow_dispatch:

jobs:
check-dist:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup nodejs 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Install dependencies
run: npm ci

- name: Rebuild dist/
run: npm run build

- name: Compare actual and expected dist/
id: diff
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "detected uncommited changes after build:"
git diff
exit 1
fi
- name: Upload expected dist/
uses: actions/upload-artifact@v4
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI

on:
pull_request:
branches:
- main
- releases/*
paths-ignore:
- '**.md'
push:
branches:
- main
- releases/*
paths-ignore:
- '**.md'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup nodejs 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Install dependencies
run: npm ci

- name: Check code format
run: npm run format-check

- name: Build
run: npm run build

- name: Test
run: npm run test

test:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.runs-on }}
needs: build

steps:
- uses: actions/checkout@v4

- name: Run local action
uses: ./
id: replace-tokens
with:
sources: |
**/*.json;!**/*.dev.json;!**/vars.json => _tmp/*.json
**/*.xml;!**.dev.xml => _tmp/*.xml
**/*.yml => _tmp/*.yml
variables: >
[
${{ toJSON(vars) }},
${{ toJSON(secrets) }},
{ "VAR2": "#{inline}#value2", "inline": "inline_" },
${{ toJSON(format('@{0}/tests/data/vars.json', github.workspace)) }},
"$ENV_VARS"
]
root: ${{ github.workspace }}/tests
log-level: debug
recursive: true
transforms: true
env:
ENV_VARS: '{ "VAR4": "env_value4" }'

- name: Check action outputs
run: |
echo "defaults : ${{ steps.replace-tokens.outputs.defaults }}"
echo "files : ${{ steps.replace-tokens.outputs.files }}"
echo "replaced : ${{ steps.replace-tokens.outputs.replaced }}"
echo "tokens : ${{ steps.replace-tokens.outputs.tokens }}"
echo "transforms: ${{ steps.replace-tokens.outputs.transforms }}"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.local/
.vscode/
node_modules/
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"endOfLine": "lf",
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": true,
"arrowParens": "avoid",
"parser": "typescript"
}
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

The MIT License (MIT)

Copyright (c) 2024 Guillaume ROUCHON

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading

0 comments on commit 25639ca

Please sign in to comment.