|
11 | 11 | types: [ published ] |
12 | 12 |
|
13 | 13 | jobs: |
14 | | - build-and-test: |
| 14 | + build: |
15 | 15 | runs-on: ubuntu-latest |
16 | 16 | steps: |
17 | | - - name: Check out repository |
18 | | - uses: actions/checkout@v3 |
19 | | - with: |
20 | | - fetch-depth: 0 |
21 | | - - name: Setup node |
22 | | - uses: actions/setup-node@v3 |
23 | | - with: |
24 | | - node-version: 16 |
25 | | - - name: setup-docker |
26 | | - uses: docker-practice/actions-setup-docker@master |
27 | | - - run: node --version |
28 | | - - run: npm --version |
29 | | - - run: docker --version |
30 | | - - run: python --version |
31 | | - - run: env |
32 | | - - name: Run npm ci |
33 | | - run: npm ci |
34 | | - - run: npm run build |
35 | | - # Unit tests |
36 | | - - run: npm install --no-save tap-xunit |
37 | | - - run: mkdir -p _out/unit _out/e2e |
38 | | - - run: npm test -- --timeout=1m |
39 | | - - name: Upload build artifact |
40 | | - uses: actions/upload-artifact@v3 |
41 | | - with: |
42 | | - name: build |
43 | | - path: ./dist |
| 17 | + - name: Check out repository |
| 18 | + uses: actions/checkout@v3 |
| 19 | + with: |
| 20 | + fetch-depth: 0 |
| 21 | + - name: Setup node |
| 22 | + uses: actions/setup-node@v3 |
| 23 | + with: |
| 24 | + node-version: 16 |
| 25 | + - name: setup-docker |
| 26 | + uses: docker-practice/actions-setup-docker@master |
| 27 | + - name: Print tooling versions |
| 28 | + run: | |
| 29 | + node --version |
| 30 | + npm --version |
| 31 | + docker --version |
| 32 | + python --version |
| 33 | + - name: Run npm ci |
| 34 | + run: npm ci |
| 35 | + - run: npm run build |
| 36 | + - name: Upload build artifact |
| 37 | + uses: actions/upload-artifact@v3 |
| 38 | + with: |
| 39 | + name: build |
| 40 | + path: ./dist |
44 | 41 |
|
45 | | - release-to-staging: |
46 | | - if: github.event_name == 'pull_request' && github.head_ref == 'main' |
47 | | - needs: build-and-test |
| 42 | + test: |
| 43 | + needs: build |
48 | 44 | runs-on: ubuntu-latest |
49 | 45 | steps: |
50 | | - - name: Check out repository |
51 | | - uses: actions/checkout@v3 |
52 | | - with: |
53 | | - fetch-depth: 0 |
54 | | - - name: Setup node |
55 | | - uses: actions/setup-node@v3 |
56 | | - with: |
57 | | - node-version: 16 |
58 | | - - name: setup-docker |
59 | | - uses: docker-practice/actions-setup-docker@master |
60 | | - - name: Download build artifact |
61 | | - uses: actions/download-artifact@v3 |
62 | | - with: |
63 | | - name: build |
64 | | - path: ./dist |
65 | | - - name: Generate version |
66 | | - run: ./create-version-file.sh |
67 | | - - name: Login to Docker Hub |
68 | | - uses: docker/login-action@v2 |
69 | | - with: |
70 | | - username: ${{ secrets.DOCKER_HUB_STAGING_LOGIN }} |
71 | | - password: ${{ secrets.DOCKER_HUB_STAGING_PASSWORD }} |
72 | | - - name: Build and push image |
73 | | - run: docker buildx build --platform linux/amd64,linux/arm64 -t orbsnetworkstaging/ethereum-writer:$(cat .version) --push . |
| 46 | + - name: Check out repository |
| 47 | + uses: actions/checkout@v3 |
| 48 | + - name: Setup node |
| 49 | + uses: actions/setup-node@v3 |
| 50 | + with: |
| 51 | + node-version: 16 |
| 52 | + - name: Download build artifact |
| 53 | + uses: actions/download-artifact@v3 |
| 54 | + with: |
| 55 | + name: build |
| 56 | + path: ./dist |
| 57 | + - run: npm install --no-save tap-xunit |
| 58 | + - run: mkdir -p _out/unit _out/e2e |
| 59 | + - run: npm test -- --timeout=1m |
| 60 | + |
| 61 | + # release-to-staging: |
| 62 | + # if: github.event_name == 'pull_request' && github.head_ref == 'main' |
| 63 | + # needs: build-and-test |
| 64 | + # runs-on: ubuntu-latest |
| 65 | + # steps: |
| 66 | + # - name: Check out repository |
| 67 | + # uses: actions/checkout@v3 |
| 68 | + # with: |
| 69 | + # fetch-depth: 0 |
| 70 | + # - name: Setup node |
| 71 | + # uses: actions/setup-node@v3 |
| 72 | + # with: |
| 73 | + # node-version: 16 |
| 74 | + # - name: setup-docker |
| 75 | + # uses: docker-practice/actions-setup-docker@master |
| 76 | + # - name: Download build artifact |
| 77 | + # uses: actions/download-artifact@v3 |
| 78 | + # with: |
| 79 | + # name: build |
| 80 | + # path: ./dist |
| 81 | + # - name: Generate version |
| 82 | + # run: ./create-version-file.sh |
| 83 | + # - name: Login to Docker Hub |
| 84 | + # uses: docker/login-action@v2 |
| 85 | + # with: |
| 86 | + # username: ${{ secrets.DOCKER_HUB_STAGING_LOGIN }} |
| 87 | + # password: ${{ secrets.DOCKER_HUB_STAGING_PASSWORD }} |
| 88 | + # - name: Build and push image |
| 89 | + # run: docker buildx build --platform linux/amd64,linux/arm64 -t orbsnetworkstaging/ethereum-writer:$(cat .version) --push . |
0 commit comments