aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/test.yml
blob: 0a07110497ece15eb17b082d0205377f804229c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
on: [ push, pull_request ]

jobs:
  test:
    runs-on: ubuntu-latest
    name: Run tests
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '16.0.0'
      - run: npm install

      - name: Run tests
        run: npm test

  build:
    runs-on: ubuntu-latest
    name: Compile Typescript
    if: github.ref == 'refs/heads/main'
    needs: [ test ]
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '16.0.0'
      - run: npm install
      - name: Compile Typescript
        uses: FuLagann/tsc-build-push@v1
        with:
          user-name: "mat-1"
          user-email: "github@matdoes.dev"
          message: "Compiled TS into JS"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  automerge:
    needs: [ build ]
    runs-on: ubuntu-latest
    steps:
      - uses: fastify/github-action-merge-dependabot@v2.1.1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          target: minor