ci: revert to npm and run git actions #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Run tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [22.9] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
redis: | |
- "7.2" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: shogo82148/actions-setup-redis@v1 | |
with: | |
auto-start: true | |
redis-version: "7.x" | |
redis-conf: "requirepass ${{ secrets.AAA_REDIS_PASSWORD }}" | |
- run: redis-cli ping | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- run: npm install | |
# - run: apt install redis-tools | |
# - run: ./wait-for-redis.sh localhost:6379 | |
- run: wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz && rm dockerize-linux-amd64-v0.6.1.tar.gz | |
- run: dockerize -wait tcp://localhost:6379 -timeout 1m | |
- run: npm run ci:test | |
env: | |
AAA_JWT_TOKEN_SECRET_KEY: ${{ secrets.AAA_JWT_TOKEN_SECRET_KEY }} | |
AAA_REDIS_PASSWORD: ${{ secrets.AAA_REDIS_PASSWORD }} |