Skip to content

Commit

Permalink
Use native nix actions in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tiziano88 committed Jun 28, 2023
1 parent c5d03ac commit c2e261f
Showing 1 changed file with 4 additions and 36 deletions.
40 changes: 4 additions & 36 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,39 +40,8 @@ jobs:
with:
fetch-depth: 2

# The runner comes with all this software pre-installed: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
# so we delete some large packages to make sure we have more space available.
#
# We print the remaining disk space between commands in order to have an idea of which of them
# have the most significant impact.
#
# Copied from https://github.com/jens-maus/RaspberryMatic/blob/ea6b8ce0dd2d53ea88b2766ba8d7f8e1d667281f/.github/workflows/ci.yml#L34-L40
# and https://github.com/actions/virtual-environments/issues/709#issuecomment-612569242
- name: Free disk space
run: |
df --human-readable
sudo apt-get remove --yes '^dotnet-.*' '^llvm-.*' 'php.*' azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell
df --human-readable
sudo apt-get autoremove --yes
df --human-readable
sudo apt clean
df --human-readable
docker rmi $(docker image ls --all --quiet)
df --human-readable
rm --recursive --force "$AGENT_TOOLSDIRECTORY"
df --human-readable
rm --recursive --force /usr/local/share/boost
df --human-readable
sudo swapoff --all
df --human-readable
sudo rm --force /swapfile
df --human-readable
- name: Docker pull
timeout-minutes: 10
run: |
./scripts/docker_pull
df --human-readable
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Run command
env:
Expand All @@ -81,10 +50,9 @@ jobs:
# Do not run tests that require KVM on GitHub Actions, since nested virtualization is not supported.
OAK_KVM_TESTS: skip
run: |
./scripts/docker_run nix develop .#ci --command ./scripts/xtask --scope=all ${{ matrix.cmd }}
df --human-readable
nix develop .#ci --command ./scripts/xtask --scope=all ${{ matrix.cmd }}
# Ensure that the previous steps did not modify our source-code and that
# relevant build artifacts are ignored by git.
- name: Git check diff
run: ./scripts/docker_run ./scripts/git_check_diff
run: ./scripts/git_check_diff

0 comments on commit c2e261f

Please sign in to comment.