|
1 | | -name: Run tests with worflow_call |
| 1 | +name: Run tests |
| 2 | + |
| 3 | +defaults: |
| 4 | + run: |
| 5 | + working-directory: . |
2 | 6 |
|
3 | 7 | on: |
4 | 8 | workflow_call: |
@@ -30,83 +34,32 @@ jobs: |
30 | 34 | name: "Run tests" |
31 | 35 | runs-on: ubuntu-latest |
32 | 36 |
|
33 | | - permissions: |
34 | | - contents: read |
35 | | - id-token: write |
36 | | - |
37 | | - strategy: |
38 | | - matrix: |
39 | | - node-version: |
40 | | - - 16.x |
41 | | - - 17.x |
42 | | - |
43 | | - steps: |
44 | | - - name: Import secrets |
45 | | - uses: hashicorp/vault-action@v2.4.3 |
46 | | - with: |
47 | | - url: https://vault.fluence.dev |
48 | | - path: jwt/github |
49 | | - role: ci |
50 | | - method: jwt |
51 | | - jwtGithubAudience: "https://github.com/fluencelabs" |
52 | | - jwtTtl: 300 |
53 | | - secrets: | |
54 | | - kv/docker-registry/basicauth/ci username | DOCKER_USERNAME ; |
55 | | - kv/docker-registry/basicauth/ci password | DOCKER_PASSWORD |
56 | | -
|
57 | | - - name: Login to DockerHub |
58 | | - uses: docker/login-action@v2 |
59 | | - with: |
60 | | - registry: docker.fluence.dev |
61 | | - username: ${{ env.DOCKER_USERNAME }} |
62 | | - password: ${{ env.DOCKER_PASSWORD }} |
63 | | - |
64 | | - - name: Checkout |
65 | | - uses: actions/checkout@v3 |
66 | | - with: |
67 | | - repository: fluencelabs/fluence-js |
68 | | - ref: ${{ inputs.ref }} |
69 | | - |
70 | | - - name: Pull rust-peer image |
71 | | - run: docker pull $RUST_PEER_IMAGE |
72 | | - |
73 | | - - name: Run rust-peer |
74 | | - uses: isbang/compose-action@v1.4.1 |
75 | | - with: |
76 | | - compose-file: ".github/e2e/docker-compose.yml" |
77 | | - down-flags: "--volumes" |
78 | | - |
79 | | - - name: Setup pnpm |
80 | | - uses: pnpm/action-setup@v2.2.4 |
81 | | - with: |
82 | | - version: 7 |
83 | | - |
84 | | - - name: Setup node ${{ matrix.node-version }} with self-hosted registry |
85 | | - uses: actions/setup-node@v3 |
86 | | - with: |
87 | | - node-version: ${{ matrix.node-version }} |
88 | | - registry-url: "https://npm.fluence.dev" |
89 | | - cache: "pnpm" |
90 | | - |
91 | | - - run: pnpm i |
92 | | - |
93 | | - - name: Set avm version |
94 | | - if: inputs.avm-version != 'null' |
95 | | - uses: fluencelabs/github-actions/npm-set-dependency@main |
96 | | - with: |
97 | | - package: "@fluencelabs/avm" |
98 | | - version: ${{ inputs.avm-version }} |
99 | | - working-directory: packages/fluence-js |
100 | | - package-manager: pnpm |
101 | | - |
102 | | - - name: Set marine-js version |
103 | | - if: inputs.marine-js-version != 'null' |
104 | | - uses: fluencelabs/github-actions/npm-set-dependency@main |
105 | | - with: |
106 | | - package: "@fluencelabs/marine-js" |
107 | | - version: ${{ inputs.marine-js-version }} |
108 | | - working-directory: packages/fluence-js |
109 | | - package-manager: pnpm |
110 | | - |
111 | | - - run: pnpm -r build |
112 | | - - run: pnpm -r test |
| 37 | + strategy: |
| 38 | + matrix: |
| 39 | + node-version: [16.x, 17.x, 18.x] |
| 40 | + |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@v2 |
| 43 | + |
| 44 | + - name: Setup Node.js ${{ matrix.node-version }} |
| 45 | + uses: actions/setup-node@v1 |
| 46 | + with: |
| 47 | + node-version: ${{ matrix.node-version }} |
| 48 | + |
| 49 | + - name: Setup pnpm |
| 50 | + uses: pnpm/action-setup@v2.2.4 |
| 51 | + with: |
| 52 | + version: 7 |
| 53 | + |
| 54 | + - name: Run container with Fluence node |
| 55 | + run: | |
| 56 | + docker pull fluencelabs/fluence |
| 57 | + docker run -d --rm -e RUST_LOG="info" -p 1210:1210 -p 4310:4310 fluencelabs/fluence -t 1210 -w 4310 -k gKdiCSUr1TFGFEgu2t8Ch1XEUsrN5A2UfBLjSZvfci9SPR3NvZpACfcpPGC3eY4zma1pk7UvYv5zb1VjvPHwCjj --local --aqua-pool-size 2 |
| 58 | +
|
| 59 | + - run: pnpm i |
| 60 | + - run: pnpm -r build |
| 61 | + env: |
| 62 | + CI: true |
| 63 | + - run: pnpm -r test |
| 64 | + env: |
| 65 | + CI: true |
0 commit comments