name: build on: push: branches: ["*"] pull_request: branches: [main] workflow_dispatch: env: CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} SLACK_BOT_TOKEN: ${{secrets.SLACK_BOT_TOKEN}} jobs: notify_start: runs-on: ubuntu-latest # Ideally this condition would be promoted to a workflow-level environment variable and shared # but this doesn't seem to be supported yet https://github.community/t/how-to-set-and-access-a-workflow-variable/17335/6 if: github.repository_owner == 'AndcultureCode' steps: - uses: voxmedia/github-action-slack-notify-build@v1 if: env.SLACK_BOT_TOKEN != '' with: channel: company-andculture-code-ci color: "#3278BD" status: STARTED build: env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true runs-on: ${{matrix.os}} needs: [notify_start] if: always() strategy: matrix: include: - { os: windows-latest, dotnet: 5.0.x, node: 14.15.5, allowed-to-fail: false, } - { os: windows-latest, dotnet: 3.1, node: 14.15.5, allowed-to-fail: false, } - { os: windows-latest, dotnet: 2.2, node: 14.15.5, allowed-to-fail: true, } - { os: macos-latest, dotnet: 3.1, node: 14.15.5, allowed-to-fail: true, } - { os: ubuntu-latest, dotnet: 3.1, node: 14.15.5, allowed-to-fail: true, } continue-on-error: ${{matrix.allowed-to-fail}} steps: - uses: actions/checkout@v2 - name: Setup node ${{matrix.node}} uses: actions/setup-node@v2 with: node-version: ${{matrix.node}} - name: npm install run: | npm install - name: Unit tests run: | npm run test:unit - name: Upload to codecov uses: codecov/codecov-action@v1 - name: Setup .NET Core SDK ${{matrix.dotnet}} uses: actions/setup-dotnet@v1.7.2 with: dotnet-version: ${{matrix.dotnet}} - name: Force .NET Core ${{matrix.dotnet}} via global.json run: | echo This step is only needed for macOS currently - see https://github.com/actions/setup-dotnet/issues/157 DOTNET_VERSION=`ls ~/.dotnet/sdk/ | grep --fixed-strings ${{matrix.dotnet}} | sort -r | head -1` echo Found $DOTNET_VERSION matching ${{matrix.dotnet}} in ~/.dotnet/sdk/ dotnet new globaljson --sdk-version "$DOTNET_VERSION" if: runner.os == 'macOS' - name: Output dotnet info run: | dotnet --info - name: Integration tests run: | npm run test:integration notify_success: runs-on: ubuntu-latest needs: [build] if: github.repository_owner == 'AndcultureCode' && success() steps: - uses: voxmedia/github-action-slack-notify-build@v1 if: env.SLACK_BOT_TOKEN != '' with: channel: company-andculture-code-ci color: good status: SUCCESS notify_failure: runs-on: ubuntu-latest needs: [build] if: github.repository_owner == 'AndcultureCode' && failure() steps: - uses: voxmedia/github-action-slack-notify-build@v1 if: env.SLACK_BOT_TOKEN != '' with: channel: company-andculture-code-ci color: danger status: FAILED