name: Daemon+CLI - Build and test on: # Build whenever a file that affects a Rust crate is changed in a pull request pull_request: paths-ignore: - '**/*.md' - .github/workflows/android*.yml - .github/workflows/frontend.yml - .github/workflows/ios.yml - .github/workflows/rustfmt.yml - .github/workflows/translations.yml - android/** - audits/** - ci/buildserver-* - ci/ci-* - dist-assets/** - docs/** - graphics/** - gui/** - ios/** - mullvad-jni/** - scripts/** - '.*ignore' - .editorconfig - .gitattributes - Dockerfile - build.sh - build-apk.sh - integration-tests.sh - prepare-release.sh - rustfmt.toml - version-metadata.sh # Build if requested manually from the Actions tab workflow_dispatch: jobs: build-linux: strategy: matrix: rust: [stable, beta, nightly] continue-on-error: ${{ matrix.rust == 'nightly' }} runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 - name: Checkout binaries submodule run: git submodule update --init --depth=1 dist-assets/binaries - name: Install Rust uses: actions-rs/toolchain@v1.0.6 with: toolchain: ${{ matrix.rust }} default: true - name: Install Go uses: actions/setup-go@v2.1.3 with: go-version: 1.16 - name: Install build dependencies run: | sudo apt-get update sudo apt-get install libdbus-1-dev - name: Build and test crates run: ./ci/check-rust.sh build-macos: runs-on: macos-latest steps: - name: Checkout repository uses: actions/checkout@v2 - name: Install Rust uses: actions-rs/toolchain@v1.0.6 with: toolchain: stable default: true - name: Install Go uses: actions/setup-go@v2.1.3 with: go-version: 1.16 - name: Build and test crates run: ./ci/check-rust.sh build-windows: runs-on: windows-latest steps: - name: Checkout repository uses: actions/checkout@v2 - name: Checkout submodules run: git submodule update --init --depth=1 - name: Calculate Windows libraries cache hash id: windows-modules-hash shell: bash run: | hash="$(git grep --recurse-submodules --cached -l '' -- './windows/' | xargs sha1sum | sha1sum | cut -d" " -f1)" echo "::set-output name=hash::$hash" - name: Cache Windows libraries uses: actions/cache@v2 id: cache-windows-modules with: path: | ./windows/*/bin/x64-*/*.dll ./windows/*/bin/x64-*/*.lib !./windows/*/bin/x64-*/libcommon.lib !./windows/*/bin/x64-*/libshared.lib !./windows/*/bin/x64-*/libwfp.lib key: windows-modules-${{ steps.windows-modules-hash.outputs.hash }} - name: Install Rust uses: actions-rs/toolchain@v1.0.6 with: toolchain: stable default: true - name: Install Go uses: actions/setup-go@v2.1.3 with: go-version: 1.16 - name: Install msbuild uses: microsoft/setup-msbuild@v1.0.2 with: vs-version: 16 - name: Build Windows modules if: steps.cache-windows-modules.outputs.cache-hit != 'true' shell: bash run: ./build-windows-modules.sh - name: Build and test crates shell: bash run: ./ci/check-rust.sh