From c845645606f6ab9469863f5f78c9c12844b3df65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20Go=C5=82awski?= Date: Wed, 1 Jun 2022 13:39:13 +0200 Subject: [PATCH 1/9] Build on push or pull request Workflow to build application after pushing to master or creating pull request for that branch. --- .github/workflows/build.yml | 36 ++++++++++++++++++++++++++++++++++++ docs/changes.txt | 1 + 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..694ba84c0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: Build + +on: + push: + branches: + - master + tags: + - v* + paths: + - 'OpenCL/**.h' + - 'OpenCL/**.cl' + - 'include/**.h' + - 'src/**.c' + - 'tools/**' + - '**/Makefile' + pull_request: + branches: + - master + paths: + - 'OpenCL/**.h' + - 'OpenCL/**.cl' + - 'include/**.h' + - 'src/**.c' + - 'tools/**' + - '**/Makefile' + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest, macos-latest] # todo: windows-latest - lack of iconv development files + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Build + run: make diff --git a/docs/changes.txt b/docs/changes.txt index a0f45ca60..1dad94c9d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -120,6 +120,7 @@ - Terminal: Increased size of hash name column in `--help` and `--identify` options. - Modules: New LUKS v1 modules (29511-29543) which do not use `module_hash_binary_parse` to get data from containers anymore (use new tool `tools/luks2hashcat.py`). - Modules: Renamed old LUKS module into LUKS v1 and added suffix *legacy* (14600). +- Workflow: Added basic workflow for GitHub Actions. * changes v6.2.4 -> v6.2.5 From a19ed55184d1ce513df0898e748a68e65a7f10a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20Go=C5=82awski?= Date: Tue, 21 Jun 2022 17:56:22 +0200 Subject: [PATCH 2/9] Add shared strategy to build static/shared binary --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 694ba84c0..3bc6ac933 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,8 +29,11 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] # todo: windows-latest - lack of iconv development files + shared: [0, 1] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - name: Build + env: + SHARED: ${{ matrix.shared }} run: make From 2715ba8a30d0808cd5faa8d1d364002c24ed1779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20Go=C5=82awski?= Date: Thu, 23 Jun 2022 14:18:56 +0200 Subject: [PATCH 3/9] Do not cancel in-progress jobs when one fails --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3bc6ac933..3a3827ba2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,7 @@ on: jobs: build: strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-latest] # todo: windows-latest - lack of iconv development files shared: [0, 1] From 249aabd195afd78c0997b9274e032847ee7cfc9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20Go=C5=82awski?= Date: Mon, 27 Jun 2022 18:12:21 +0200 Subject: [PATCH 4/9] Add badge in README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d102d505c..927523f97 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,9 @@ Refer to [BUILD.md](BUILD.md) for instructions on how to build **hashcat** from Tests: -Travis | Appveyor | Coverity ------- | -------- | -------- -[![Hashcat Travis Build status](https://travis-ci.org/hashcat/hashcat.svg?branch=master)](https://travis-ci.org/hashcat/hashcat) | [![Hashcat Appveyor Build status](https://ci.appveyor.com/api/projects/status/github/hashcat/hashcat?branch=master&svg=true)](https://ci.appveyor.com/project/jsteube/hashcat) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/11753/badge.svg)](https://scan.coverity.com/projects/hashcat) +Travis | Appveyor | Coverity | GitHub Actions +------ | -------- | -------- | -------------- +[![Hashcat Travis Build status](https://travis-ci.org/hashcat/hashcat.svg?branch=master)](https://travis-ci.org/hashcat/hashcat) | [![Hashcat Appveyor Build status](https://ci.appveyor.com/api/projects/status/github/hashcat/hashcat?branch=master&svg=true)](https://ci.appveyor.com/project/jsteube/hashcat) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/11753/badge.svg)](https://scan.coverity.com/projects/hashcat) | [![Hashcat GitHub Actions Build status](https://github.com/hashcat/hashcat/actions/workflows/build.yml/badge.svg)](https://github.com/hashcat/hashcat/actions/workflows/build.yml) ### Contributing ### From c7965208d4454443f0ac4d83974a85a39a3e9aab Mon Sep 17 00:00:00 2001 From: Matt <5032824+mdawsonuk@users.noreply.github.com> Date: Thu, 14 Jul 2022 17:11:57 +0100 Subject: [PATCH 5/9] Add artifacts to GitHub Actions pipeline --- .github/workflows/build.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a3827ba2..13ac438c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,18 @@ name: Build +env: + include_paths: | + charsets/ + docs/ + extra/ + layouts/ + masks/ + modules/ + OpenCL/ + rules/ + example* + hashcat* + on: push: branches: @@ -13,6 +26,7 @@ on: - 'src/**.c' - 'tools/**' - '**/Makefile' + - '.github/workflows/build.yml' pull_request: branches: - master @@ -23,6 +37,7 @@ on: - 'src/**.c' - 'tools/**' - '**/Makefile' + - '.github/workflows/build.yml' jobs: build: @@ -38,3 +53,8 @@ jobs: env: SHARED: ${{ matrix.shared }} run: make + - name: Generate artifacts (shared) + uses: actions/upload-artifact@v3 + with: + name: hashcat-${{ matrix.os }}-${{ matrix.shared }} + path: ${{ env.include_paths }} From 0355b9323806342d65ac263c7338cd56649cae83 Mon Sep 17 00:00:00 2001 From: Matt <5032824+mdawsonuk@users.noreply.github.com> Date: Thu, 14 Jul 2022 19:30:47 +0100 Subject: [PATCH 6/9] Add WSL build, fix missing .so, improved artifact naming --- .github/workflows/build.yml | 45 ++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13ac438c6..e169d289d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,7 @@ env: rules/ example* hashcat* + libhashcat* on: push: @@ -44,17 +45,51 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] # todo: windows-latest - lack of iconv development files + os: [ubuntu-latest, macos-latest, windows-latest] # todo: windows-latest - lack of iconv development files shared: [0, 1] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Build + - name: Checkout Hashcat + uses: actions/checkout@v3 + - name: Checkout win-iconv + uses: actions/checkout@v3 + if: ${{ matrix.os == 'windows-latest' }} + with: + repository: win-iconv/win-iconv + path: 'win-iconv/' + clean: false + - name: Install WSL + uses: Vampire/setup-wsl@v1 + if: ${{ matrix.os == 'windows-latest' }} + with: + additional-packages: + gcc-mingw-w64-x86-64 + g++-mingw-w64-x86-64 + make + git + patch + - name: Setup WSL + if: ${{ matrix.os == 'windows-latest' }} + shell: wsl-bash {0} + run: cd win-iconv/ && patch < ../tools/win-iconv-64.diff && sudo make install + - name: Build (Win) + if: ${{ matrix.os == 'windows-latest' }} + shell: wsl-bash {0} + run: make win + - name: Build (Unix) + if: ${{ matrix.os != 'windows-latest' }} env: SHARED: ${{ matrix.shared }} run: make - - name: Generate artifacts (shared) + - name: Generate static artifacts + if: ${{ matrix.shared == 0 }} + uses: actions/upload-artifact@v3 + with: + name: hashcat-${{ runner.os }}-static + path: ${{ env.include_paths }} + - name: Generate shared artifacts + if: ${{ matrix.shared == 1 }} uses: actions/upload-artifact@v3 with: - name: hashcat-${{ matrix.os }}-${{ matrix.shared }} + name: hashcat-${{ runner.os }}-shared path: ${{ env.include_paths }} From 53ed6c33e8e35dc89f837eefc756264e7130bde8 Mon Sep 17 00:00:00 2001 From: kgolawski Date: Fri, 15 Jul 2022 01:22:35 +0200 Subject: [PATCH 7/9] Update workflow to build on Windows runner --- .github/workflows/build.yml | 111 ++++++++++++++++++++---------------- 1 file changed, 63 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e169d289d..da7d0e8e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,17 +2,17 @@ name: Build env: include_paths: | - charsets/ - docs/ - extra/ - layouts/ - masks/ - modules/ - OpenCL/ - rules/ - example* - hashcat* - libhashcat* + charsets/ + docs/ + extra/ + layouts/ + masks/ + modules/ + OpenCL/ + rules/ + example* + hashcat* + libhashcat* on: push: @@ -41,55 +41,70 @@ on: - '.github/workflows/build.yml' jobs: - build: + build-linux: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] # todo: windows-latest - lack of iconv development files shared: [0, 1] - runs-on: ${{ matrix.os }} + name: Build Linux (${{ matrix.shared == 0 && 'Static' || 'Shared' }}) + runs-on: ubuntu-latest steps: - - name: Checkout Hashcat - uses: actions/checkout@v3 - - name: Checkout win-iconv - uses: actions/checkout@v3 - if: ${{ matrix.os == 'windows-latest' }} - with: - repository: win-iconv/win-iconv - path: 'win-iconv/' - clean: false - - name: Install WSL - uses: Vampire/setup-wsl@v1 - if: ${{ matrix.os == 'windows-latest' }} + - uses: actions/checkout@v3 + - name: Build + env: + SHARED: ${{ matrix.shared }} + run: make + - name: Generate artifacts + uses: actions/upload-artifact@v3 with: - additional-packages: - gcc-mingw-w64-x86-64 - g++-mingw-w64-x86-64 - make - git - patch - - name: Setup WSL - if: ${{ matrix.os == 'windows-latest' }} - shell: wsl-bash {0} - run: cd win-iconv/ && patch < ../tools/win-iconv-64.diff && sudo make install - - name: Build (Win) - if: ${{ matrix.os == 'windows-latest' }} - shell: wsl-bash {0} - run: make win - - name: Build (Unix) - if: ${{ matrix.os != 'windows-latest' }} + name: Hashcat-${{ runner.os }}-${{ matrix.shared == 0 && 'Static' || 'Shared' }} + path: ${{ env.include_paths }} + + build-macos: + strategy: + fail-fast: false + matrix: + shared: [0, 1] + name: Build MacOS (${{ matrix.shared == 0 && 'Static' || 'Shared' }}) + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - name: Build env: SHARED: ${{ matrix.shared }} run: make - - name: Generate static artifacts - if: ${{ matrix.shared == 0 }} + - name: Generate artifacts uses: actions/upload-artifact@v3 with: - name: hashcat-${{ runner.os }}-static + name: Hashcat-${{ runner.os }}-${{ matrix.shared == 0 && 'Static' || 'Shared' }} path: ${{ env.include_paths }} - - name: Generate shared artifacts - if: ${{ matrix.shared == 1 }} + + build-windows: + strategy: + fail-fast: false + matrix: + shared: [0, 1] + name: Build Windows (${{ matrix.shared == 0 && 'Static' || 'Shared' }}) + runs-on: windows-latest + steps: + - name: Install libiconv + uses: msys2/setup-msys2@v2 + with: + update: true + install: | + gcc + git + libiconv + libiconv-devel + make + - uses: actions/checkout@v3 + - name: Build + shell: msys2 {0} + env: + SHARED: ${{ matrix.shared }} + run: make + - name: Generate artifacts uses: actions/upload-artifact@v3 with: - name: hashcat-${{ runner.os }}-shared + name: Hashcat-${{ runner.os }}-${{ matrix.shared == 0 && 'Static' || 'Shared' }} path: ${{ env.include_paths }} From 0486bf2bbe16aef218e23e1d2b69bde2ccd0c7f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20Go=C5=82awski?= Date: Fri, 15 Jul 2022 01:27:22 +0200 Subject: [PATCH 8/9] Tiny change with macOS runner name --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da7d0e8e3..89b745dc4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,7 @@ jobs: fail-fast: false matrix: shared: [0, 1] - name: Build MacOS (${{ matrix.shared == 0 && 'Static' || 'Shared' }}) + name: Build macOS (${{ matrix.shared == 0 && 'Static' || 'Shared' }}) runs-on: macos-latest steps: - uses: actions/checkout@v3 From 62f72a263b1ec14aa50daa4b0e35fb02153fbfd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20Go=C5=82awski?= Date: Tue, 19 Jul 2022 14:27:16 +0200 Subject: [PATCH 9/9] Use lowercase artifacts names --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89b745dc4..81990ba77 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,7 @@ jobs: - name: Generate artifacts uses: actions/upload-artifact@v3 with: - name: Hashcat-${{ runner.os }}-${{ matrix.shared == 0 && 'Static' || 'Shared' }} + name: hashcat-linux-${{ matrix.shared == 0 && 'static' || 'shared' }} path: ${{ env.include_paths }} build-macos: @@ -76,7 +76,7 @@ jobs: - name: Generate artifacts uses: actions/upload-artifact@v3 with: - name: Hashcat-${{ runner.os }}-${{ matrix.shared == 0 && 'Static' || 'Shared' }} + name: hashcat-macos-${{ matrix.shared == 0 && 'static' || 'shared' }} path: ${{ env.include_paths }} build-windows: @@ -106,5 +106,5 @@ jobs: - name: Generate artifacts uses: actions/upload-artifact@v3 with: - name: Hashcat-${{ runner.os }}-${{ matrix.shared == 0 && 'Static' || 'Shared' }} + name: hashcat-windows-${{ matrix.shared == 0 && 'static' || 'shared' }} path: ${{ env.include_paths }}