diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..316cb9c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,18 @@ +on: [push] + +jobs: + redis-action: + runs-on: ubuntu-latest + strategy: + matrix: + redis-version: ["4", "5"] + + name: Start Redis Server v${{ matrix.redis-version }} + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Start Redis Server + uses: ./ + with: + redis-version: ${{ matrix.redis-version }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e0d357c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + + +## 1.0.0 - 2019-12-xx + +### Added +- `1.0.0` release 🚀 🎉 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..35a6ec7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM docker:stable +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..5b48b2d --- /dev/null +++ b/README.md @@ -0,0 +1,81 @@ +
+ + + +
+
+

+

Redis GitHub Action

+

+

+ Start a Redis server in your GitHub Actions. +

+
+

+ Usage +

+
+
+

+ Latest Version +

+

+ Follow @marcuspoehls and @superchargejs for updates! +

+
+ +--- + + +## Introduction +This GitHub Action starts a Redis server on the default port `6379`. + +This is useful when running tests against a Redis database. + + +## Usage +A code example says more than a 1000 words. Here’s an exemplary GitHub Action using a Redis server in versions 4 and 5 to test a Node.js app: + +```yaml +name: Run tests + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [8.x, 10.x, 12.x, 13.x] + redis-version: [4, 5] + + steps: + - name: Git checkout + uses: actions/checkout@v1 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Start Redis + uses: superchargejs/redis-github-action@v1 + with: + redis-version: ${{ matrix.redis-version }} + + - run: npm install + + - run: npm test + env: + CI: true +``` + + +## License +MIT © [Supercharge](https://superchargejs.com) + +--- + +> [superchargejs.com](https://superchargejs.com)  ·  +> GitHub [@superchargejs](https://github.com/superchargejs/)  ·  +> Twitter [@superchargejs](https://twitter.com/superchargejs) diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..c05f125 --- /dev/null +++ b/action.yml @@ -0,0 +1,16 @@ +name: 'Redis Server in GitHub Actions' +description: 'Start a Redis server (on default port 6379)' + +branding: + icon: 'database' + color: 'red' + +inputs: + redis-version: + description: 'Redis version to use' + required: false + default: 'latest' + +runs: + using: 'docker' + image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..a1e3658 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +sh -c "docker run -d -p 6379:6379 redis:$INPUT_REDIS_VERSION"