feat: canfund exploration #719
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: Tests | |
on: | |
pull_request: | |
paths: | |
- 'src/satellite/**' | |
- 'src/orbiter/**' | |
- 'src/console/**' | |
- 'src/observatory/**' | |
- 'src/mission_control/**' | |
- 'src/libs/**' | |
- 'src/tests/**' | |
- 'rust-toolchain.toml' | |
- 'Cargo.toml' | |
- 'docker/**' | |
jobs: | |
docker-build-base: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build Base Docker Image | |
uses: ./.github/actions/docker-build-base | |
docker-build: | |
runs-on: ubuntu-latest | |
needs: docker-build-base | |
strategy: | |
matrix: | |
include: | |
- name: satellite | |
wasm: satellite.wasm.gz | |
target: scratch_satellite | |
- name: orbiter | |
wasm: orbiter.wasm.gz | |
target: scratch_orbiter | |
- name: console | |
wasm: console.wasm.gz | |
target: scratch_console | |
- name: observatory | |
wasm: observatory.wasm.gz | |
target: scratch_observatory | |
- name: mission_control | |
wasm: mission_control.wasm.gz | |
target: scratch_mission_control | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up docker buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build ${{ matrix.name }} | |
uses: docker/build-push-action@v5 | |
with: | |
file: Dockerfile | |
cache-from: type=gha,scope=cached-stage | |
# Exports the artefacts from the final stage | |
outputs: ./out | |
target: ${{ matrix.target }} | |
- run: mv out/${{ matrix.wasm }} ${{ matrix.wasm }} | |
- name: Upload ${{ matrix.name }} | |
uses: actions/upload-artifact@v4 | |
with: | |
# name is the name used to display and retrieve the artifact | |
name: ${{ matrix.wasm }} | |
# path is the name used as the file to upload and the name of the | |
# downloaded file | |
path: ./${{ matrix.wasm }} | |
tests: | |
runs-on: ubuntu-latest | |
needs: docker-build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Prepare | |
uses: ./.github/actions/prepare | |
- name: Download satellite.wasm.gz | |
uses: actions/download-artifact@v4 | |
with: | |
name: satellite.wasm.gz | |
path: . | |
- name: Download orbiter.wasm.gz | |
uses: actions/download-artifact@v4 | |
with: | |
name: orbiter.wasm.gz | |
path: . | |
- name: Download console.wasm.gz | |
uses: actions/download-artifact@v4 | |
with: | |
name: console.wasm.gz | |
path: . | |
- name: Download observatory.wasm.gz | |
uses: actions/download-artifact@v4 | |
with: | |
name: observatory.wasm.gz | |
path: . | |
- name: Download mission_control.wasm.gz | |
uses: actions/download-artifact@v4 | |
with: | |
name: mission_control.wasm.gz | |
path: . | |
- name: Tests | |
run: npm run test | |
may-merge: | |
needs: ['tests'] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cleared for merging | |
run: echo OK |