|
| 1 | +name: ci |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - develop |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - master |
| 11 | + - develop |
| 12 | + |
| 13 | +defaults: |
| 14 | + run: |
| 15 | + working-directory: redcode |
| 16 | + |
| 17 | +jobs: |
| 18 | + build_redcode: |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + os: |
| 22 | + - macos-latest |
| 23 | + - ubuntu-latest |
| 24 | + - windows-latest |
| 25 | + runs-on: ${{ matrix.os }} |
| 26 | + steps: |
| 27 | + - name: Checkout branch |
| 28 | + uses: actions/checkout@v2 |
| 29 | + - name: Install Node.js |
| 30 | + uses: actions/setup-node@v1 |
| 31 | + with: |
| 32 | + node-version: 14.x |
| 33 | + - name: Install dependencies |
| 34 | + run: npm install --locked |
| 35 | + - name: Build extension |
| 36 | + run: npm run build |
| 37 | + - name: Verify the build did not modify any files |
| 38 | + run: git diff --exit-code HEAD -- . |
| 39 | + |
| 40 | + lint_rust: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + steps: |
| 43 | + - name: Checkout branch |
| 44 | + uses: actions/checkout@v2 |
| 45 | + - name: Setup default Rust toolchain |
| 46 | + uses: actions-rs/toolchain@v1 |
| 47 | + with: |
| 48 | + components: clippy,rustfmt |
| 49 | + - name: Check formatting |
| 50 | + run: cargo fmt --all --verbose -- --check |
| 51 | + - name: Run clippy linting |
| 52 | + run: cargo clippy --color=always --workspace --verbose --all-targets |
| 53 | + env: |
| 54 | + RUSTFLAGS: |
| 55 | + "-D warnings" |
| 56 | + |
| 57 | + validate_rust: |
| 58 | + strategy: |
| 59 | + matrix: |
| 60 | + os: |
| 61 | + - macos-latest |
| 62 | + - ubuntu-latest |
| 63 | + - windows-latest |
| 64 | + toolchain: |
| 65 | + - stable |
| 66 | + - beta |
| 67 | + - nightly |
| 68 | + continue-on-error: ${{ matrix.toolchain != 'stable' || matrix.os == 'windows-latest' }} |
| 69 | + runs-on: ${{ matrix.os }} |
| 70 | + steps: |
| 71 | + - name: Checkout branch |
| 72 | + uses: actions/checkout@v2 |
| 73 | + - name: Setup Rust toolchain |
| 74 | + uses: actions-rs/toolchain@v1 |
| 75 | + with: |
| 76 | + toolchain: ${{ matrix.toolchain }} |
| 77 | + - name: Build and run tests |
| 78 | + run: cargo test --color=always --workspace |
0 commit comments