Revert "chore(ci): Run GitHub Actions on ubuntu-22.04-arm
"
#181
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint & Test | |
on: | |
push: | |
branches: | |
- master | |
# Do not run the workflow if the project hasn't changed. | |
paths: | |
# We changed the code: | |
- "crates/*/src/**" | |
- "crates/*/src/Cargo.toml" | |
- "Cargo.toml" | |
- "Cargo.lock" | |
# We changed how the image is built: | |
- "Dockerfile" | |
- ".dockerignore" | |
# We changed how the workflow is ran: | |
- ".github/workflows/test.yaml" | |
# We changed some packaged documentation: | |
- "crates/*/static/**" | |
# We changed how tests are ran: | |
- "crates/*/tests/**" | |
- "local-run/scenarios/demo/**" | |
- "tests/**" | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
# Do not run the workflow if the project hasn't changed. | |
paths: | |
# We changed the code: | |
- "crates/*/src/**" | |
- "crates/*/src/Cargo.toml" | |
- "Cargo.toml" | |
- "Cargo.lock" | |
# We changed how the image is built: | |
- "Dockerfile" | |
- ".dockerignore" | |
# We changed how the workflow is ran: | |
- ".github/workflows/test.yaml" | |
# We changed some packaged documentation: | |
- "crates/*/static/**" | |
# We changed how tests are ran: | |
- "crates/*/tests/**" | |
- "local-run/scenarios/demo/**" | |
- "tests/**" | |
jobs: | |
lint-rust: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- name: Verify versions | |
run: rustc --version && rustup --version && cargo --version | |
- name: Check code style | |
run: cargo fmt -- --check | |
lint-openapi: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Redocly CLI | |
run: npm install -g @redocly/cli@latest | |
- name: Lint OpenAPI specification file | |
run: scripts/openapi-lint | |
smoke-test: | |
if: github.event.pull_request.draft == false | |
needs: [lint-rust, lint-openapi] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Verify versions | |
run: rustc --version && rustup --version && cargo --version | |
- name: Cache build context | |
id: cache-cargo | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo | |
- name: Try building in release mode | |
run: cargo check --release | |
- name: Install SQLite3 | |
run: sudo apt-get update && sudo apt-get install -y sqlite3 | |
- name: Test code in debug mode | |
run: cargo test | |
integration-test: | |
if: github.event.pull_request.draft == false | |
needs: smoke-test | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout prose-pod-api | |
uses: actions/checkout@v4 | |
with: | |
path: ${{ env.PROSE_POD_API_DIR }} | |
submodules: true | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Verify versions | |
run: rustc --version && rustup --version && cargo --version | |
- name: Cache build context | |
id: cache-cargo | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo | |
# NOTE: Recommended by [the Task documentation](https://taskfile.dev/installation/#github-actions). | |
- name: Install Task | |
uses: arduino/setup-task@v2 | |
- name: Build image | |
# NOTE: We need to build in debug mode because we need to use | |
# `debug_only` configuration during integration tests. | |
run: task build-image -- --profile=dev --locked | |
- name: Install SQLite3 | |
run: sudo apt-get update && sudo apt-get install -y sqlite3 | |
# Install our fork of Step CI (has more features we need). | |
# - name: Install Step CI | |
# run: npm install -g stepci | |
- name: Checkout stepci-runner | |
uses: actions/checkout@v4 | |
with: | |
repository: RemiBardon/stepci-runner | |
ref: prose | |
path: ${{ github.workspace }}/stepci-runner | |
- name: Build stepci-runner | |
run: | | |
cd "${{ github.workspace }}/stepci-runner" | |
npm install | |
npm run build | |
npm link | |
- name: Checkout stepci | |
uses: actions/checkout@v4 | |
with: | |
repository: RemiBardon/stepci | |
ref: prose | |
path: ${{ github.workspace }}/stepci | |
- name: Build & install stepci | |
run: | | |
cd "${{ github.workspace }}/stepci" | |
# NOTE: `npm install` must be ran **before** `npm link @stepci/runner` | |
# otherwise the link doesn't work properly and `stepci` fails at runtime | |
# because of missing fixes from our branch. | |
npm install | |
npm link @stepci/runner | |
npm run build | |
npm install -g . | |
- name: Run integration tests | |
run: task integration-test |