Skip to content

Commit

Permalink
fix: try to switch CI/CD to ubuntu github-hosted runner
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-semenov committed May 11, 2024
1 parent f14460a commit a2e6dba
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 26 deletions.
25 changes: 9 additions & 16 deletions .github/workflows/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,22 @@ on:

jobs:
Compile-All:
runs-on: macos-12
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Cache Vagrant boxes
uses: actions/[email protected]
- name: Install Nix
uses: cachix/install-nix-action@v26
with:
path: ~/.vagrant.d/boxes
key: $${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }}
restore-keys: |
${{ runner.os }}-vagrant-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix-path: nixpkgs=channel:nixos-unstable

- name: Show Vagrant version
run: vagrant --version

- name: Run vagrant up & provision
- name: Compile TextMate Grammar
run: |
vagrant plugin install vagrant-disksize
vagrant up --provision
env:
VER: 23.05
chmod +x ./scripts/compile-grammar.sh
./scripts/compile-grammar.sh
- name: Get Coverage Badge SVG
- name: Compile Coverage Badge SVG
run: make -B $(pwd)/images/coverage-badge.svg

- name: Import GPG key
Expand Down
12 changes: 4 additions & 8 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Vagrant.configure("2") do |config|
config.vm.box = "nixbox/nixos"
config.vm.box_version = ver.to_s

config.disksize.size = '8GB'
config.disksize.size = '10GB'

config.vm.provider "virtualbox" do |vb|
vb.gui = false
Expand All @@ -17,12 +17,8 @@ Vagrant.configure("2") do |config|
config.vm.synced_folder ".", "/vagrant"

config.vm.provision "shell", privileged: false, inline: <<-'SHELL'
cd /vagrant/
nix --version
df -h
echo "statix check && \
nix flake check --impure && \
cp \$(nix build --impure --no-link --print-out-paths)/parigp* ./syntaxes/" | \
nix-shell --run bash
SCRIPTNAME=scripts/compile-grammar.sh
chmod +x /vagrant/$SCRIPTNAME
/vagrant/$SCRIPTNAME
SHELL
end
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{
packages.${current_system}.default =

with import nixpkgs { system = current_system; };
with import ./nixpkgs.nix { system = current_system; };
let vscode_tmgrammar_test =
buildNpmPackage rec {
pname = "vscode-tmgrammar-test";
Expand Down
7 changes: 7 additions & 0 deletions nixpkgs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let
lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
in
import (fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
sha256 = lock.narHash;
})
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs ? (import <nixpkgs>) {} }:
{ pkgs ? (import ./nixpkgs.nix) {} }:
pkgs.mkShell {
NIX_CONFIG = "experimental-features = nix-command flakes";
nativeBuildInputs = with pkgs; [
Expand Down

0 comments on commit a2e6dba

Please sign in to comment.