|
| 1 | +name:coder |
| 2 | + |
| 3 | +on: |
| 4 | +push: |
| 5 | +branches: |
| 6 | + -main |
| 7 | + -"release/*" |
| 8 | +tags: |
| 9 | + -"*" |
| 10 | + |
| 11 | +pull_request: |
| 12 | +branches: |
| 13 | + -main |
| 14 | + -"release/*" |
| 15 | + |
| 16 | +workflow_dispatch: |
| 17 | + |
| 18 | +permissions: |
| 19 | +actions:none |
| 20 | +checks:none |
| 21 | +contents:read |
| 22 | +deployments:none |
| 23 | +issues:none |
| 24 | +packages:none |
| 25 | +pull-requests:none |
| 26 | +repository-projects:none |
| 27 | +security-events:none |
| 28 | +statuses:none |
| 29 | + |
| 30 | +jobs: |
| 31 | +style: |
| 32 | +name:"style/${{ matrix.style }}" |
| 33 | +runs-on:ubuntu-latest |
| 34 | +strategy: |
| 35 | +matrix: |
| 36 | +style: |
| 37 | + -fmt |
| 38 | +fail-fast:false |
| 39 | +permissions: |
| 40 | +actions:write# for cancel-workflow-action |
| 41 | +contents:read |
| 42 | +steps: |
| 43 | + -name:Cancel previous runs |
| 44 | +if:github.event_name == 'pull_request' |
| 45 | +uses:styfle/cancel-workflow-action@0.9.1 |
| 46 | + |
| 47 | + -name:Checkout |
| 48 | +uses:actions/checkout@v2 |
| 49 | +with: |
| 50 | +fetch-depth:0 |
| 51 | +submodules:true |
| 52 | + |
| 53 | + -name:Cache Node |
| 54 | +id:cache-node |
| 55 | +uses:actions/cache@v2 |
| 56 | +with: |
| 57 | +path:| |
| 58 | + **/node_modules |
| 59 | + .eslintcache |
| 60 | +key:js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }} |
| 61 | + |
| 62 | + -name:Install node_modules |
| 63 | +run:yarn install |
| 64 | + |
| 65 | + -name:"make ${{ matrix.style }}" |
| 66 | +run:"make --output-sync -j ${{ matrix.style }}" |
| 67 | + |
| 68 | +test-go: |
| 69 | +name:"test/go" |
| 70 | +runs-on:${{ matrix.os }} |
| 71 | +strategy: |
| 72 | +matrix: |
| 73 | +os: |
| 74 | + -ubuntu-latest |
| 75 | + -macos-latest |
| 76 | + -windows-latest |
| 77 | +steps: |
| 78 | + -uses:actions/checkout@v2 |
| 79 | + |
| 80 | + -uses:actions/setup-go@v2 |
| 81 | +with: |
| 82 | +go-version:"^1.17" |
| 83 | + |
| 84 | +# Check that go is available |
| 85 | +# TODO: Implement actual test run |
| 86 | + -run:go version |
| 87 | + |
| 88 | +test-js: |
| 89 | +name:"test/js" |
| 90 | +runs-on:ubuntu-latest |
| 91 | +steps: |
| 92 | + -uses:actions/checkout@v2 |
| 93 | + |
| 94 | + -uses:actions/setup-node@v2 |
| 95 | +with: |
| 96 | +node-version:"14" |
| 97 | + |
| 98 | +# Check that node is available |
| 99 | +# TODO: Implement actual test run |
| 100 | + -run:node --version |