mirror of
https://github.com/tests-always-included/mo.git
synced 2026-04-08 08:50:38 +02:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54195a6c6e | ||
|
|
81f9ec326d | ||
|
|
dae1c66f8f | ||
|
|
08576fca7b | ||
|
|
3aa5c462f8 | ||
|
|
a28ed0ccd5 | ||
|
|
c86fd9a89b | ||
|
|
03eb3925ac | ||
|
|
8e3e08a42b |
13
.github/workflows/ci.yaml
vendored
Normal file
13
.github/workflows/ci.yaml
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
name: CI
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
- name: Run tests
|
||||||
|
run: ./run-tests
|
||||||
|
- name: Run against spec
|
||||||
|
run: ./run-spec
|
||||||
45
.github/workflows/release.yaml
vendored
Normal file
45
.github/workflows/release.yaml
vendored
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
name: docker push
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
push_to_registry:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- name: Docker meta
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
id: docker_meta
|
||||||
|
uses: crazy-max/ghaction-docker-meta@v1
|
||||||
|
with:
|
||||||
|
images: ghcr.io/${{ github.repository }}
|
||||||
|
tag-match: v(.*)
|
||||||
|
- name: Set up QEMU
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
- name: Cache Docker layers
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
with:
|
||||||
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
push: true
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -5,3 +5,5 @@ tests/*.diff
|
|||||||
spec/
|
spec/
|
||||||
spec-runner/
|
spec-runner/
|
||||||
node_modules/
|
node_modules/
|
||||||
|
package.json
|
||||||
|
package-lock.json
|
||||||
|
|||||||
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
FROM alpine:3.13.4
|
||||||
|
|
||||||
|
COPY ./mo .
|
||||||
|
RUN apk add --update bash && \
|
||||||
|
chmod +x mo &&\
|
||||||
|
mv mo /usr/local/bin/mo && \
|
||||||
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
WORKDIR /opt
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/local/bin/mo"]
|
||||||
2
mo
2
mo
@@ -302,7 +302,7 @@ moFindEndTag() {
|
|||||||
moFindString() {
|
moFindString() {
|
||||||
local pos string
|
local pos string
|
||||||
|
|
||||||
string=${2%%$3*}
|
string=${2%%"$3"*}
|
||||||
[[ "$string" == "$2" ]] && pos=-1 || pos=${#string}
|
[[ "$string" == "$2" ]] && pos=-1 || pos=${#string}
|
||||||
local "$1" && moIndirect "$1" "$pos"
|
local "$1" && moIndirect "$1" "$pos"
|
||||||
}
|
}
|
||||||
|
|||||||
10
package.json
10
package.json
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"dependencies": {
|
|
||||||
"async": "*"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"clean": "rm -rf package-lock.json node_modules/ spec/",
|
|
||||||
"install-tests": "npm install; git clone https://github.com/mustache/spec.git spec",
|
|
||||||
"test": "node run-spec.js spec/specs/*.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
20
run-spec
Executable file
20
run-spec
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Create a package.json so the dependency package is installed in the local
|
||||||
|
# directory
|
||||||
|
echo '{"private":true, "dependencies":{"async": "*"}}' > package.json
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# Install or update the specs
|
||||||
|
if [[ ! -d spec ]]; then
|
||||||
|
git clone https://github.com/mustache/spec.git spec
|
||||||
|
else
|
||||||
|
(
|
||||||
|
cd spec;
|
||||||
|
git pull
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Actually run the specs
|
||||||
|
node run-spec.js spec/specs/*.json
|
||||||
|
|
||||||
Reference in New Issue
Block a user