Skip to content

Commit 017c5b2

Browse files
committed
Improve CI workflow
1 parent 9f02a20 commit 017c5b2

File tree

9 files changed

+62
-54
lines changed

9 files changed

+62
-54
lines changed

.cargo/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ rustflags = [
2929
# Used by the GitHub CI workflow.
3030
# This profile is necessary since the workflow cannot simply set the environment variables
3131
# RUSTFLAGS and RUSTDOCFLAGS itself without overwriting the meticulously chosen flags set above!
32+
# With profiles, those flags are inherited from / appended to the parent.
3233
[profile.ci]
3334
inherits = "release"
3435
rustflags = ["-Dwarnings"]

.github/workflows/ci.yml

Lines changed: 54 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,22 @@ on:
1212
# config file whose registered Rust flags are *appended* to the parent profile's ones.
1313
env:
1414
CARGO_TERM_COLOR: always
15+
RUSTUP_TOOLCHAIN: nightly
16+
17+
# @Task add back dependency caching once we've figured out how to do it properly
18+
# (before: always cache misses)
1519

1620
jobs:
1721
build-on-linux:
18-
name: Build on Linux (Ubuntu)
22+
name: Build on (Ubuntu) Linux
1923

2024
runs-on: ubuntu-latest
2125

2226
steps:
23-
- uses: actions/checkout@v3
24-
- uses: dtolnay/rust-toolchain@master
25-
with:
26-
toolchain: nightly
27+
- name: Check out the repository
28+
uses: actions/checkout@v3
29+
- name: Install Rust
30+
run: rustup update --no-self-update nightly
2731
- name: Build in release mode
2832
# @Task build with LLVM
2933
run: cargo build --profile ci --features cranelift,lsp
@@ -37,29 +41,30 @@ jobs:
3741
runs-on: windows-latest
3842

3943
steps:
40-
- uses: actions/checkout@v3
41-
- uses: dtolnay/rust-toolchain@master
42-
with:
43-
toolchain: nightly
44+
- name: Check out the repository
45+
uses: actions/checkout@v3
46+
- name: Install Rust
47+
run: rustup update --no-self-update nightly
4448
- name: Build in release mode
4549
# @Task build with LLVM
4650
run: cargo build --profile ci --features cranelift,lsp
4751

4852
test-on-linux:
49-
name: Run tests on Linux (Ubuntu)
53+
name: Run tests on (Ubuntu) Linux
5054

5155
needs: build-on-linux
5256
runs-on: ubuntu-latest
5357

5458
steps:
55-
- uses: actions/checkout@v3
56-
- uses: dtolnay/rust-toolchain@master
57-
with:
58-
toolchain: nightly
59-
- name: Run unit tests (via the rust testing framework)
60-
run: cargo test
61-
- name: Run UI tests (via the golden UI testing framework)
62-
# @Task build with LLVM and Cranelift
59+
- name: Check out the repository
60+
uses: actions/checkout@v3
61+
- name: Install Rust
62+
run: rustup update --no-self-update nightly
63+
- name: Run unit tests
64+
# @Task test with LLVM
65+
run: cargo test --workspace --exclude llvm_codegen --features cranelift,lsp
66+
- name: Run UI tests
67+
# @Task test with LLVM and Cranelift
6368
run: ./test/ui/run --release --timeout=20
6469

6570
test-on-windows:
@@ -72,29 +77,30 @@ jobs:
7277
runs-on: windows-latest
7378

7479
steps:
75-
- uses: actions/checkout@v3
76-
- uses: dtolnay/rust-toolchain@master
77-
with:
78-
toolchain: nightly
79-
- name: Run unit tests (via the rust testing framework)
80-
run: cargo test
81-
- name: Run UI tests (via the golden UI testing framework)
80+
- name: Check out the repository
81+
uses: actions/checkout@v3
82+
- name: Install Rust
83+
run: rustup update --no-self-update nightly
84+
- name: Run unit tests
85+
# @Task test with LLVM
86+
run: cargo test --workspace --exclude llvm_codegen --features cranelift,lsp
87+
- name: Run UI tests
8288
# @Task build with LLVM and Cranelift
8389
run: ./tests/ui/run --release --timeout=20
8490

8591
build-documentation:
86-
name: Build Documentation (on Linux)
92+
name: Build documentation (on Linux)
8793

8894
needs: build-on-linux
8995
runs-on: ubuntu-latest
9096

9197
steps:
92-
- uses: actions/checkout@v3
93-
- uses: dtolnay/rust-toolchain@master
94-
with:
95-
toolchain: nightly
96-
- name: Build documentation with rustdoc excluding dependencies
97-
# @Task build with LLVM
98+
- name: Check out the repository
99+
uses: actions/checkout@v3
100+
- name: Install Rust
101+
run: rustup update --no-self-update nightly
102+
- name: Build documentation with rustdoc
103+
# @Task document with LLVM
98104
run: cargo doc --profile ci --no-deps --features cranelift,lsp
99105

100106
clippy:
@@ -104,25 +110,27 @@ jobs:
104110
runs-on: ubuntu-latest
105111

106112
steps:
107-
- uses: actions/checkout@v3
108-
- uses: dtolnay/rust-toolchain@master
109-
with:
110-
toolchain: nightly
111-
components: clippy
113+
- name: Check out the repository
114+
uses: actions/checkout@v3
115+
- name: Install Rust
116+
run: |
117+
rustup update --no-self-update nightly
118+
rustup component add clippy
112119
- name: Run Clippy
113-
# @Task build with LLVM
120+
# @Task check with LLVM
114121
run: cargo clippy --profile ci --features cranelift,lsp
115122

116123
formatting:
117-
name: Check Code Formatting
124+
name: Check code formatting
118125

119126
runs-on: ubuntu-latest
120127

121128
steps:
122-
- uses: actions/checkout@v3
123-
- uses: dtolnay/rust-toolchain@master
124-
with:
125-
toolchain: nightly
126-
components: rustfmt
127-
- name: Run rustfmt in check mode
128-
run: cargo fmt --check
129+
- name: Check out the repository
130+
uses: actions/checkout@v3
131+
- name: Install Rust
132+
run: |
133+
rustup update --no-self-update nightly
134+
rustup component add rustfmt
135+
- name: Check code formatting
136+
run: cargo fmt --all --check

compiler/driver/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(generic_arg_infer, let_chains)]
1+
#![feature(generic_arg_infer)]
22

33
use std::process::Command;
44

compiler/driver/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
default_free_fn,
55
let_else,
66
associated_type_bounds,
7-
let_chains,
87
type_alias_impl_trait
98
)]
109

compiler/llvm_codegen/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! The LLVM-IR generator.
2-
#![feature(default_free_fn, let_chains)]
2+
#![feature(default_free_fn)]
33
#![allow(clippy::match_same_arms)] // @Temporary
44

55
use diagnostics::Diagnostic;

compiler/package/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! The package and component resolver.
2-
#![feature(default_free_fn, let_chains, let_else, try_trait_v2)]
2+
#![feature(default_free_fn, let_else, try_trait_v2)]
33

44
use diagnostics::{reporter::ErasedReportedError, Diagnostic, ErrorCode, Reporter};
55
use error::Result;

compiler/resolver/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! respectively.
99
// @Task improve docs above!
1010
// @Task get rid of "register" terminology
11-
#![feature(default_free_fn, let_chains, let_else)]
11+
#![feature(default_free_fn, let_else)]
1212

1313
use colored::Colorize;
1414
use diagnostics::{reporter::ErasedReportedError, Diagnostic, ErrorCode, LintCode};

compiler/server/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! An LSP language server for the Lushui programming language.
2-
#![feature(default_free_fn, let_chains, let_else)]
2+
#![feature(default_free_fn, let_else)]
33

44
use self::diagnostics::DiagnosticExt;
55
use self::span::{FromPositionExt, ToLocationExt};

lushui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#
33
# Build and run the Lushui compiler.
44
#
5-
# By default, optional compiler feature are not built.
6-
# All program arguments are passed to the compiler
5+
# By default, optional compiler features are not built.
6+
# All program arguments of this script are passed to the compiler
77
# except for the first one if it starts with a ‘+’.
88
# In such case, the argument denotes a comma-separated
99
# list of compiler features.

0 commit comments

Comments
 (0)