Skip to content

Commit

Permalink
Add CI for gitlab.
Browse files Browse the repository at this point in the history
Add CI to gitlatb.

Removes action/checkout.

Back to github action/checkout.

First true intent at CI.

Second intent.

Test 3.

Test 4.

Test 5

Test 6.

Rework order of builds.

Better settings of "continue-on-action".

TEst des targets.

Better cache config.

Nothing, just change hash.

Store artifacts.

Use other os for true.

Test upload artefact on windows.

Save doc in artifacts.

Change name of job.
  • Loading branch information
ElieGouzien committed May 31, 2024
1 parent 636add4 commit 8b0e975
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: ci

on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full

jobs:
build_and_test:
name: Check, compile, run and doc - ${{matrix.os}} - ${{matrix.toolchain}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolchain: [stable]
steps:
- uses: actions/checkout@v4
- name: Install rust (${{matrix.os}}-${{matrix.toolchain}})
run: rustup update ${{matrix.toolchain}} && rustup default ${{matrix.toolchain}}
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo
key: ${{runner.os}}-cargo-registry-${{github.sha}}
restore-keys: ${{runner.os}}-cargo-registry-
- name: Cache cargo target
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-target-${{github.sha}}
restore-keys: ${{runner.os}}-cargo-target-
- name: fmt
continue-on-error: true
run: cargo fmt --check
- name: clippy
continue-on-error: true
run: cargo clippy -- -D warnings
- name: Build debug
run: cargo build
- name: build release
run: cargo build --release
- name: Save executable
uses: actions/upload-artifact@v4
with:
name: ${{matrix.os}}-qsharp-alice-bob-resource-estimator
path: target/release/qsharp-alice-bob-resource-estimator${{ runner.os == 'Windows' && '.exe' || ''}}
- name: test
run: cargo test
- name: example elliptic_log
run: cargo run --example=elliptic_log
- name: example from_qsharp
run: cargo run --example=from_qsharp
- name: doc
run: cargo doc --release --no-deps
- name: Save doc
uses: actions/upload-artifact@v4
with:
name: ${{matrix.os}}-doc
path: target/doc

0 comments on commit 8b0e975

Please sign in to comment.