name: coder on: push: branches: - main - "release/*" tags: - "*" pull_request: branches: - main - "release/*" workflow_dispatch: permissions: actions: none checks: none contents: read deployments: none issues: none packages: none pull-requests: none repository-projects: none security-events: none statuses: none jobs: style-lint-golangci: name: style/lint/golangci runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: version: v1.43.0 style-lint-typescript: name: "style/lint/typescript" runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Cache Node id: cache-node uses: actions/cache@v2 with: path: | **/node_modules .eslintcache key: js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }} - name: Install node_modules run: yarn install - name: "yarn lint" run: yarn lint gen: name: "style/gen" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Install Protoc uses: arduino/setup-protoc@v1 with: version: "3.6.1" - uses: actions/setup-go@v2 with: go-version: "^1.17" - run: curl -sSL https://github.com/kyleconroy/sqlc/releases/download/v1.11.0/sqlc_1.11.0_linux_amd64.tar.gz | sudo tar -C /usr/bin -xz sqlc - run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 - run: go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26 - run: "make --output-sync -j gen" - run: ./scripts/check_unstaged.sh style: name: "style/${{ matrix.style }}" runs-on: ubuntu-latest strategy: matrix: style: - fmt fail-fast: false permissions: actions: write # for cancel-workflow-action contents: read steps: - name: Cancel previous runs if: github.event_name == 'pull_request' uses: styfle/cancel-workflow-action@0.9.1 - name: Checkout uses: actions/checkout@v2 with: fetch-depth: 0 submodules: true - name: Cache Node id: cache-node uses: actions/cache@v2 with: path: | **/node_modules .eslintcache key: js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }} - name: Install node_modules run: yarn install - name: "make ${{ matrix.style }}" run: "make --output-sync -j ${{ matrix.style }}" test-go: name: "test/go" runs-on: ${{ matrix.os }} strategy: matrix: os: - ubuntu-latest - macos-latest - windows-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: go-version: "^1.17" - uses: actions/cache@v2 with: # Go mod cache, Linux build cache, Mac build cache, Windows build cache path: | ~/go/pkg/mod ~/.cache/go-build ~/Library/Caches/go-build %LocalAppData%\go-build key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - run: go install gotest.tools/gotestsum@latest - name: Test with Mock Database run: gotestsum --jsonfile="gotests.json" --packages="./..." -- -covermode=atomic -coverprofile="gotests.coverage" -timeout=3m -count=3 -race -parallel=2 - name: Test with PostgreSQL Database if: runner.os == 'Linux' run: DB=true gotestsum --jsonfile="gotests.json" --packages="./..." -- -covermode=atomic -coverprofile="gotests.coverage" -timeout=3m -count=1 -race -parallel=1 - uses: codecov/codecov-action@v2 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./gotests.coverage flags: unittest-go-${{ matrix.os }} fail_ci_if_error: true test-js: name: "test/js" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Cache Node id: cache-node uses: actions/cache@v2 with: path: | **/node_modules .eslintcache key: js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }} - uses: actions/setup-node@v2 with: node-version: "14" - run: yarn install - run: yarn build - run: yarn test:coverage - uses: codecov/codecov-action@v2 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage/lcov.info flags: unittest-js fail_ci_if_error: true