Skip to content

Commit b4b0212

Browse files
Consolidate Rust and VSCode CI
Apparently GitHub does not allow for required checks that don't always run: https://github.community/t/feature-request-conditional-required-checks/16761/8 This will just make all the CI run every PR which is fine since the checks are pretty quick overall.
1 parent 8031e11 commit b4b0212

File tree

3 files changed

+80
-45
lines changed

3 files changed

+80
-45
lines changed

.github/workflows/ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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

.github/workflows/redcode-publish.yml renamed to .github/workflows/publish_redcode.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
name: redcode-publish
1+
name: publish_redcode
22

33
on:
44
release:
55
types:
6-
- created
7-
- edited
6+
- published
87

98
defaults:
109
run:

.github/workflows/redcode-ci.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)