name: Build on: pull_request: push: jobs: tests: strategy: matrix: os: - ubuntu-latest - macos-11 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2.3.5 - name: Obtain current username run: | echo ACTION_USER=$USER >> $GITHUB_ENV - uses: DeterminateSystems/nix-installer@main with: extra-conf: | trusted-users = root ${{ env.ACTION_USER }} - name: Install Attic run: ./.github/install-attic-ci.sh - name: Configure Attic run: | export PATH=$HOME/.nix-profile/bin:$PATH # FIXME attic login staging https://staging.attic.rs/ "$ATTIC_TOKEN" attic use attic-ci env: ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }} - name: Build and run tests run: | system=$(nix-instantiate --eval -E 'builtins.currentSystem') echo system=$system >>$GITHUB_ENV tests=$(nix build .#internal."$system".attic-tests --no-link --print-out-paths -L) find "$tests/bin" -exec {} \; # TODO: Just take a diff of the list of store paths, also abstract all of this out - name: Push build artifacts run: | export PATH=$HOME/.nix-profile/bin:$PATH # FIXME if [ -n "$ATTIC_TOKEN" ]; then nix build .#internal."$system".attic-tests .#internal."$system".cargoArtifacts --no-link --print-out-paths -L | \ xargs attic push attic-ci fi env: ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}