2023-02-15 14:45:04 +00:00
|
|
|
name: "ci"
|
2022-09-06 14:51:43 +00:00
|
|
|
|
|
|
|
on:
|
2023-02-15 14:45:04 +00:00
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
|
|
|
- ".github/**"
|
|
|
|
- "!.github/workflows/e2e.yml"
|
|
|
|
- "!.github/workflows/tests.yml"
|
|
|
|
- "!.github/workflows/snapshot.yml"
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "master"
|
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
|
|
|
- ".github/**"
|
|
|
|
- "!.github/workflows/e2e.yml"
|
|
|
|
- "!.github/workflows/tests.yml"
|
|
|
|
- "!.github/workflows/snapshot.yml"
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
|
|
|
cancel-in-progress: true
|
2022-09-06 14:51:43 +00:00
|
|
|
|
|
|
|
env:
|
2023-02-15 14:45:04 +00:00
|
|
|
RUST_PEER_IMAGE: "fluencelabs/fluence:minimal"
|
2022-09-06 14:51:43 +00:00
|
|
|
FORCE_COLOR: true
|
|
|
|
CI: true
|
|
|
|
|
|
|
|
jobs:
|
2023-02-15 00:00:42 +00:00
|
|
|
fluence-js:
|
|
|
|
name: "Run tests"
|
2022-09-06 14:51:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
id-token: write
|
|
|
|
|
2023-02-15 00:00:42 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version:
|
|
|
|
- 16.x
|
|
|
|
- 17.x
|
2023-02-15 14:45:04 +00:00
|
|
|
- 18.x
|
2023-02-15 00:00:42 +00:00
|
|
|
|
2022-09-06 14:51:43 +00:00
|
|
|
steps:
|
2023-02-15 00:00:42 +00:00
|
|
|
- name: Import secrets
|
|
|
|
uses: hashicorp/vault-action@v2.4.3
|
|
|
|
with:
|
|
|
|
url: https://vault.fluence.dev
|
|
|
|
path: jwt/github
|
|
|
|
role: ci
|
|
|
|
method: jwt
|
|
|
|
jwtGithubAudience: "https://github.com/fluencelabs"
|
|
|
|
jwtTtl: 300
|
|
|
|
secrets: |
|
|
|
|
kv/docker-registry/basicauth/ci username | DOCKER_USERNAME ;
|
|
|
|
kv/docker-registry/basicauth/ci password | DOCKER_PASSWORD
|
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: docker.fluence.dev
|
|
|
|
username: ${{ env.DOCKER_USERNAME }}
|
|
|
|
password: ${{ env.DOCKER_PASSWORD }}
|
|
|
|
|
|
|
|
- name: Checkout
|
2022-09-06 14:51:43 +00:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-02-15 00:00:42 +00:00
|
|
|
- name: Pull rust-peer image
|
|
|
|
run: docker pull $RUST_PEER_IMAGE
|
|
|
|
|
|
|
|
- name: Run rust-peer
|
|
|
|
uses: isbang/compose-action@v1.4.1
|
|
|
|
with:
|
|
|
|
compose-file: ".github/e2e/docker-compose.yml"
|
|
|
|
down-flags: "--volumes"
|
|
|
|
|
|
|
|
- name: Setup pnpm
|
|
|
|
uses: pnpm/action-setup@v2.2.4
|
2022-09-06 14:51:43 +00:00
|
|
|
with:
|
|
|
|
version: 7
|
|
|
|
|
2023-02-15 00:00:42 +00:00
|
|
|
- name: Setup node ${{ matrix.node-version }} with self-hosted registry
|
2022-09-13 16:24:20 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-09-06 14:51:43 +00:00
|
|
|
with:
|
2023-02-15 00:00:42 +00:00
|
|
|
node-version: ${{ matrix.node-version }}
|
2022-09-06 14:51:43 +00:00
|
|
|
registry-url: "https://npm.fluence.dev"
|
2022-09-13 16:24:20 +00:00
|
|
|
cache: "pnpm"
|
|
|
|
|
2022-09-14 14:43:17 +00:00
|
|
|
- run: pnpm i
|
|
|
|
|
2022-11-22 13:39:45 +00:00
|
|
|
- run: pnpm -r build
|
2023-02-15 00:00:42 +00:00
|
|
|
- run: pnpm -r test
|